1add_subdirectory(generic)
2if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_ARCHITECTURE})
3  add_subdirectory(${LIBC_TARGET_ARCHITECTURE})
4endif()
5
6function(add_math_entrypoint_object name)
7  # We prefer machine specific implementation if available. Hence we check
8  # that first and return early if we are able to add an alias target for the
9  # machine specific implementation.
10  get_fq_target_name("${LIBC_TARGET_ARCHITECTURE}.${name}" fq_machine_specific_target_name)
11  if(TARGET ${fq_machine_specific_target_name})
12    add_entrypoint_object(
13      ${name}
14      ALIAS
15      DEPENDS
16        .${LIBC_TARGET_ARCHITECTURE}.${name}
17    )
18    return()
19  endif()
20
21  get_fq_target_name("generic.${name}" fq_generic_target_name)
22  if(TARGET ${fq_generic_target_name})
23    add_entrypoint_object(
24      ${name}
25      ALIAS
26      DEPENDS
27        .generic.${name}
28    )
29    return()
30  endif()
31
32  # Add a dummy entrypoint object for missing implementations. They will be skipped
33  # anyway as there will be no entry for them in the target entrypoints list.
34  add_entrypoint_object(
35    ${name}
36    SRCS
37      dummy_srcs
38    HDRS
39      dummy_hdrs
40  )
41endfunction()
42
43add_entrypoint_object(
44  fmaf
45  SRCS
46    fmaf.cpp
47  HDRS
48    fmaf.h
49  DEPENDS
50    libc.src.__support.FPUtil.fputil
51  COMPILE_OPTIONS
52    -O2
53)
54
55add_entrypoint_object(
56  fma
57  SRCS
58    fma.cpp
59  HDRS
60    fma.h
61  DEPENDS
62    libc.src.__support.FPUtil.fputil
63  COMPILE_OPTIONS
64    -O2
65)
66
67add_math_entrypoint_object(ceil)
68add_math_entrypoint_object(ceilf)
69add_math_entrypoint_object(ceill)
70
71add_math_entrypoint_object(copysign)
72add_math_entrypoint_object(copysignf)
73add_math_entrypoint_object(copysignl)
74
75add_math_entrypoint_object(cos)
76add_math_entrypoint_object(cosf)
77
78add_math_entrypoint_object(expf)
79
80add_math_entrypoint_object(exp2f)
81
82add_math_entrypoint_object(expm1f)
83
84add_math_entrypoint_object(fabs)
85add_math_entrypoint_object(fabsf)
86add_math_entrypoint_object(fabsl)
87
88add_math_entrypoint_object(fdim)
89add_math_entrypoint_object(fdimf)
90add_math_entrypoint_object(fdiml)
91
92add_math_entrypoint_object(floor)
93add_math_entrypoint_object(floorf)
94add_math_entrypoint_object(floorl)
95
96add_math_entrypoint_object(fmax)
97add_math_entrypoint_object(fmaxf)
98add_math_entrypoint_object(fmaxl)
99
100add_math_entrypoint_object(fmin)
101add_math_entrypoint_object(fminf)
102add_math_entrypoint_object(fminl)
103
104add_math_entrypoint_object(frexp)
105add_math_entrypoint_object(frexpf)
106add_math_entrypoint_object(frexpl)
107
108add_math_entrypoint_object(hypot)
109add_math_entrypoint_object(hypotf)
110
111add_math_entrypoint_object(ilogb)
112add_math_entrypoint_object(ilogbf)
113add_math_entrypoint_object(ilogbl)
114
115add_math_entrypoint_object(ldexp)
116add_math_entrypoint_object(ldexpf)
117add_math_entrypoint_object(ldexpl)
118
119add_math_entrypoint_object(logf)
120
121add_math_entrypoint_object(logb)
122add_math_entrypoint_object(logbf)
123add_math_entrypoint_object(logbl)
124
125add_math_entrypoint_object(llrint)
126add_math_entrypoint_object(llrintf)
127add_math_entrypoint_object(llrintl)
128
129add_math_entrypoint_object(llround)
130add_math_entrypoint_object(llroundf)
131add_math_entrypoint_object(llroundl)
132
133add_math_entrypoint_object(lrint)
134add_math_entrypoint_object(lrintf)
135add_math_entrypoint_object(lrintl)
136
137add_math_entrypoint_object(lround)
138add_math_entrypoint_object(lroundf)
139add_math_entrypoint_object(lroundl)
140
141add_math_entrypoint_object(modf)
142add_math_entrypoint_object(modff)
143add_math_entrypoint_object(modfl)
144
145add_math_entrypoint_object(nearbyint)
146add_math_entrypoint_object(nearbyintf)
147add_math_entrypoint_object(nearbyintl)
148
149add_math_entrypoint_object(nextafter)
150add_math_entrypoint_object(nextafterf)
151add_math_entrypoint_object(nextafterl)
152
153add_math_entrypoint_object(remainder)
154add_math_entrypoint_object(remainderf)
155add_math_entrypoint_object(remainderl)
156
157add_math_entrypoint_object(remquo)
158add_math_entrypoint_object(remquof)
159add_math_entrypoint_object(remquol)
160
161add_math_entrypoint_object(rint)
162add_math_entrypoint_object(rintf)
163add_math_entrypoint_object(rintl)
164
165add_math_entrypoint_object(round)
166add_math_entrypoint_object(roundf)
167add_math_entrypoint_object(roundl)
168
169add_math_entrypoint_object(sincosf)
170
171add_math_entrypoint_object(sin)
172add_math_entrypoint_object(sinf)
173
174add_math_entrypoint_object(sqrt)
175add_math_entrypoint_object(sqrtf)
176add_math_entrypoint_object(sqrtl)
177
178add_math_entrypoint_object(tan)
179
180add_math_entrypoint_object(trunc)
181add_math_entrypoint_object(truncf)
182add_math_entrypoint_object(truncl)
183