Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libc / src / math / CMakeLists.txt
blobf1f72714981a9e502de507acc306d98271417c80
1 add_subdirectory(generic)
2 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_ARCHITECTURE})
3   add_subdirectory(${LIBC_TARGET_ARCHITECTURE})
4 endif()
6 function(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()
21   # The GPU optionally depends on vendor libraries. If we emitted one of these
22   # entrypoints it means the user requested it and we should use it instead.
23   get_fq_target_name("${LIBC_TARGET_ARCHITECTURE}.vendor.${name}" fq_vendor_specific_target_name)
24   if(TARGET ${fq_vendor_specific_target_name})
25     add_entrypoint_object(
26       ${name}
27       ALIAS
28       DEPENDS
29         .${LIBC_TARGET_ARCHITECTURE}.vendor.${name}
30       VENDOR
31     )
32     return()
33   endif()
35   get_fq_target_name("generic.${name}" fq_generic_target_name)
36   if(TARGET ${fq_generic_target_name})
37     add_entrypoint_object(
38       ${name}
39       ALIAS
40       DEPENDS
41         .generic.${name}
42     )
43     return()
44   endif()
46   # Add a dummy entrypoint object for missing implementations. They will be skipped
47   # anyway as there will be no entry for them in the target entrypoints list.
48   add_entrypoint_object(
49     ${name}
50     SRCS
51       dummy_srcs
52     HDRS
53       dummy_hdrs
54   )
55 endfunction()
57 add_math_entrypoint_object(acos)
58 add_math_entrypoint_object(acosf)
59 add_math_entrypoint_object(acosh)
60 add_math_entrypoint_object(acoshf)
62 add_math_entrypoint_object(asin)
63 add_math_entrypoint_object(asinf)
64 add_math_entrypoint_object(asinh)
65 add_math_entrypoint_object(asinhf)
67 add_math_entrypoint_object(atan)
68 add_math_entrypoint_object(atanf)
70 add_math_entrypoint_object(atan2)
71 add_math_entrypoint_object(atan2f)
73 add_math_entrypoint_object(atanh)
74 add_math_entrypoint_object(atanhf)
76 add_math_entrypoint_object(ceil)
77 add_math_entrypoint_object(ceilf)
78 add_math_entrypoint_object(ceill)
80 add_math_entrypoint_object(copysign)
81 add_math_entrypoint_object(copysignf)
82 add_math_entrypoint_object(copysignl)
84 add_math_entrypoint_object(cos)
85 add_math_entrypoint_object(cosf)
86 add_math_entrypoint_object(cosh)
87 add_math_entrypoint_object(coshf)
89 add_math_entrypoint_object(erf)
90 add_math_entrypoint_object(erff)
92 add_math_entrypoint_object(exp)
93 add_math_entrypoint_object(expf)
95 add_math_entrypoint_object(exp2)
96 add_math_entrypoint_object(exp2f)
98 add_math_entrypoint_object(exp10)
99 add_math_entrypoint_object(exp10f)
101 add_math_entrypoint_object(expm1)
102 add_math_entrypoint_object(expm1f)
104 add_math_entrypoint_object(fabs)
105 add_math_entrypoint_object(fabsf)
106 add_math_entrypoint_object(fabsl)
108 add_math_entrypoint_object(fdim)
109 add_math_entrypoint_object(fdimf)
110 add_math_entrypoint_object(fdiml)
112 add_math_entrypoint_object(floor)
113 add_math_entrypoint_object(floorf)
114 add_math_entrypoint_object(floorl)
116 add_math_entrypoint_object(fma)
117 add_math_entrypoint_object(fmaf)
119 add_math_entrypoint_object(fmax)
120 add_math_entrypoint_object(fmaxf)
121 add_math_entrypoint_object(fmaxl)
123 add_math_entrypoint_object(fmin)
124 add_math_entrypoint_object(fminf)
125 add_math_entrypoint_object(fminl)
127 add_math_entrypoint_object(fmod)
128 add_math_entrypoint_object(fmodf)
130 add_math_entrypoint_object(frexp)
131 add_math_entrypoint_object(frexpf)
132 add_math_entrypoint_object(frexpl)
134 add_math_entrypoint_object(hypot)
135 add_math_entrypoint_object(hypotf)
137 add_math_entrypoint_object(ilogb)
138 add_math_entrypoint_object(ilogbf)
139 add_math_entrypoint_object(ilogbl)
141 add_math_entrypoint_object(ldexp)
142 add_math_entrypoint_object(ldexpf)
143 add_math_entrypoint_object(ldexpl)
145 add_math_entrypoint_object(log10)
146 add_math_entrypoint_object(log10f)
148 add_math_entrypoint_object(log1p)
149 add_math_entrypoint_object(log1pf)
151 add_math_entrypoint_object(log2)
152 add_math_entrypoint_object(log2f)
154 add_math_entrypoint_object(log)
155 add_math_entrypoint_object(logf)
157 add_math_entrypoint_object(logb)
158 add_math_entrypoint_object(logbf)
159 add_math_entrypoint_object(logbl)
161 add_math_entrypoint_object(llrint)
162 add_math_entrypoint_object(llrintf)
163 add_math_entrypoint_object(llrintl)
165 add_math_entrypoint_object(llround)
166 add_math_entrypoint_object(llroundf)
167 add_math_entrypoint_object(llroundl)
169 add_math_entrypoint_object(lrint)
170 add_math_entrypoint_object(lrintf)
171 add_math_entrypoint_object(lrintl)
173 add_math_entrypoint_object(lround)
174 add_math_entrypoint_object(lroundf)
175 add_math_entrypoint_object(lroundl)
177 add_math_entrypoint_object(modf)
178 add_math_entrypoint_object(modff)
179 add_math_entrypoint_object(modfl)
181 add_math_entrypoint_object(nearbyint)
182 add_math_entrypoint_object(nearbyintf)
183 add_math_entrypoint_object(nearbyintl)
185 add_math_entrypoint_object(nextafter)
186 add_math_entrypoint_object(nextafterf)
187 add_math_entrypoint_object(nextafterl)
189 add_math_entrypoint_object(pow)
190 add_math_entrypoint_object(powf)
192 add_math_entrypoint_object(remainder)
193 add_math_entrypoint_object(remainderf)
194 add_math_entrypoint_object(remainderl)
196 add_math_entrypoint_object(remquo)
197 add_math_entrypoint_object(remquof)
198 add_math_entrypoint_object(remquol)
200 add_math_entrypoint_object(rint)
201 add_math_entrypoint_object(rintf)
202 add_math_entrypoint_object(rintl)
204 add_math_entrypoint_object(round)
205 add_math_entrypoint_object(roundf)
206 add_math_entrypoint_object(roundl)
208 add_math_entrypoint_object(scalbn)
209 add_math_entrypoint_object(scalbnf)
210 add_math_entrypoint_object(scalbnl)
212 add_math_entrypoint_object(sincos)
213 add_math_entrypoint_object(sincosf)
215 add_math_entrypoint_object(sin)
216 add_math_entrypoint_object(sinf)
218 add_math_entrypoint_object(sinh)
219 add_math_entrypoint_object(sinhf)
221 add_math_entrypoint_object(sqrt)
222 add_math_entrypoint_object(sqrtf)
223 add_math_entrypoint_object(sqrtl)
225 add_math_entrypoint_object(tan)
226 add_math_entrypoint_object(tanf)
228 add_math_entrypoint_object(tanh)
229 add_math_entrypoint_object(tanhf)
231 add_math_entrypoint_object(tgamma)
232 add_math_entrypoint_object(tgammaf)
234 add_math_entrypoint_object(trunc)
235 add_math_entrypoint_object(truncf)
236 add_math_entrypoint_object(truncl)