Skip to content

Commit 9ee1847

Browse files
committed
[CRT_APITEST] Add a tests for exp(f) / __libm_sse2_exp(f)
1 parent c4a2dbd commit 9ee1847

File tree

6 files changed

+405
-0
lines changed

6 files changed

+405
-0
lines changed

modules/rostests/apitests/crt/exp.c

Lines changed: 387 additions & 0 deletions
Large diffs are not rendered by default.

modules/rostests/apitests/crt/gen_math_tests.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ def generate_cos_table(func_name = "cos", typecode = 'd'):
166166
def generate_cosf_table():
167167
generate_cos_table("cosf", 'f')
168168

169+
def generate_exp_table(func_name = "exp", typecode = 'd'):
170+
gen_table_header(func_name)
171+
gen_table_range(func_name, typecode, mp.exp, -100.0, -0.9, 33, 1)
172+
gen_table_range(func_name, typecode, mp.exp, -1.0, 1.0, 33, 1)
173+
gen_table_range(func_name, typecode, mp.exp, 1.1, 100.0, 33, 1)
174+
print("};\n")
175+
176+
def generate_expf_table():
177+
generate_exp_table("expf", 'f')
178+
169179
# Dictionary to map math function names to generator functions
170180
TABLE_FUNCTIONS = {
171181
"acos": generate_acos_table,
@@ -176,6 +186,8 @@ def generate_cosf_table():
176186
"atanf": generate_atanf_table,
177187
"cos": generate_cos_table,
178188
"cosf": generate_cosf_table,
189+
"exp": generate_exp_table,
190+
"expf": generate_expf_table,
179191
}
180192

181193
def main():

modules/rostests/apitests/msvcrt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ list(APPEND SOURCE_CRT_TESTS
2424
../crt/ceil.c
2525
../crt/cos.c
2626
../crt/crtdata.c
27+
../crt/exp.c
2728
../crt/fabs.c
2829
../crt/floor.c
2930
../crt/mbstowcs.c

modules/rostests/apitests/msvcrt/testlist.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern void func_atexit(void);
1919
extern void func_ceil(void);
2020
extern void func_cos(void);
2121
extern void func_crtdata(void);
22+
extern void func_exp(void);
2223
extern void func_fabs(void);
2324
extern void func_floor(void);
2425
extern void func_fpcontrol(void);
@@ -67,6 +68,7 @@ const struct test winetest_testlist[] =
6768
{ "ceil", func_ceil },
6869
{ "cos", func_cos },
6970
{ "crtdata", func_crtdata },
71+
{ "exp", func_exp },
7072
{ "fabs", func_fabs },
7173
{ "floor", func_floor },
7274
{ "mbstowcs", func_mbstowcs },

modules/rostests/apitests/ucrtbase/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ list(APPEND SOURCE
1616
../crt/atan.c
1717
../crt/ceil.c
1818
../crt/cos.c
19+
../crt/exp.c
1920
../crt/round.c
2021
testlist.c
2122
)

modules/rostests/apitests/ucrtbase/testlist.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ extern void func_asin(void);
88
extern void func_atan(void);
99
extern void func_ceil(void);
1010
extern void func_cos(void);
11+
extern void func_exp(void);
1112
extern void func_round(void);
1213

1314

@@ -18,6 +19,7 @@ const struct test winetest_testlist[] =
1819
{ "atan", func_atan },
1920
{ "ceil", func_ceil },
2021
{ "cos", func_cos },
22+
{ "exp", func_exp },
2123
{ "round", func_round },
2224

2325
{ 0, 0 }

0 commit comments

Comments
 (0)