Skip to content

Commit 08b9d8c

Browse files
committed
math: test C99 functions only
1 parent eee5459 commit 08b9d8c

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

config.mak.def

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,80 @@ else # Use openlibm
2424
endif # USE_OPENLIBM
2525

2626

27+
# -- [C99]
28+
C99_SRC:=fenv
29+
# Cpp: Classification
30+
C99_SRC+=fpclassify
31+
# TODO: isfinite isinf isnan isnormal signbit
32+
# C99: Trigonometric
33+
C99_SRC+=acos acosf acosl asin asinf asinl atan atanf atanl
34+
C99_SRC+=atan2 atan2f atan2l
35+
C99_SRC+=cos cosf cosl sin sinf sinl tan tanf tanl
36+
# C99: Hyperbolic
37+
C99_SRC+=acosh acoshf acoshl asinh asinhf asinhl atanh atanhf atanhl
38+
C99_SRC+=cosh coshf coshl sinh sinhf sinhl tanh tanhf tanhl
39+
# C99: Exponential and logarithmic
40+
C99_SRC+=exp expf expl exp2 exp2f exp2l expm1 expm1f expm1l
41+
C99_SRC+=frexp frexpf frexpl ilogb ilogbf ilogbl ldexp ldexpf ldexpl
42+
C99_SRC+=log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
43+
C99_SRC+=logb logbf logbl log logf logl
44+
C99_SRC+=modf modff modfl
45+
C99_SRC+=scalbn scalbnf scalbnl scalbln scalblnf scalblnl
46+
# C99: Power and Absolute-value
47+
C99_SRC+=pow powf powl sqrt sqrtf sqrtl cbrt cbrtf cbrtl
48+
C99_SRC+=hypot hypotf hypotl
49+
C99_SRC+=fabs fabsf fabsl
50+
# C99: Error and gamma
51+
C99_SRC+=erf erff erfl erfc erfcf erfcl
52+
C99_SRC+=lgamma lgammaf lgammal tgamma tgammaf tgammal
53+
# C99: Nearest integer
54+
C99_SRC+=ceil ceilf ceill floor floorf floorl
55+
C99_SRC+=nearbyint nearbyintf nearbyintl
56+
C99_SRC+=rint rintf rintl lrint lrintf lrintl llrint llrintf llrintl
57+
C99_SRC+=round roundf roundl lround lroundf lroundl llround llroundf llroundl
58+
C99_SRC+=trunc truncf truncl
59+
# C99: Remainder
60+
C99_SRC+=fmod fmodf fmodl remainder remainderf remainderl remquo remquof remquol
61+
# C99: Manipulation
62+
C99_SRC+=copysign copysignf copysignl
63+
C99_SRC+=nextafter nextafterf nextafterl nexttoward nexttowardf nexttowardl
64+
# TODO: nan
65+
# C99: Maximum, minimum
66+
C99_SRC+=fdim fdimf fdiml fmax fmaxf fmaxl fmin fminf fminl
67+
# C99: Floating multiply-add
68+
C99_SRC+=fma fmaf fmal
69+
# C99: Comparison
70+
C99_SRC+=isless
71+
# TODO: isgreater isgreaterequal islessequal islessgreater isunordered
72+
# -- [C23]
73+
C23_SRC:=exp10 exp10f exp10l
74+
# -- [BSD]
75+
BSD_SRC:=drem dremf
76+
BSD_SRC+=j0 j0f j1 j1f jn jnf
77+
BSD_SRC+=lgamma_r lgammaf_r lgammal_r
78+
BSD_SRC+=scalb scalbf
79+
BSD_SRC+=y0 y0f y1 y1f yn ynf
80+
# -- [GNU]
81+
GNU_SRC:=pow10 pow10f pow10l sincos sincosf sincosl
82+
83+
# Collect all c src files
84+
SRCS:=$(C99_SRC:%=src/math/%.c)
85+
# SRCS+=$(C23_SRC:%=src/math/%.c)
86+
# SRCS+=$(BSD_SRC:%=src/math/%.c)
87+
# SRCS+=$(GNU_SRC:%=src/math/%.c)
88+
89+
SRCS+=$(wildcard src/api/*.c)
90+
SRCS+=$(wildcard src/common/*.c)
91+
_MATH_SRC:=$(sort $(wildcard src/math/*.c))
92+
SRCS:=$(sort $(SRCS))
93+
#
94+
OBJS:=$(SRCS:src/%.c=$(B)/%.o)
95+
LOBJS:=$(SRCS:src/%.c=$(B)/%.lo)
96+
DIRS:=$(patsubst src/%/,%,$(sort $(dir $(SRCS))))
97+
BDIRS:=$(DIRS:%=$(B)/%)
98+
NAMES:=$(SRCS:src/%.c=%)
99+
100+
27101
# Makefile debugging trick:
28102
# call print-VARIABLE to see the runtime value of any variable
29103
# (hardened against any special characters appearing in the output)

0 commit comments

Comments
 (0)