[Workflow] Roll back some settings since they caused more issues
[llvm-project.git] / libc / src / math / CMakeLists.txt
blob8b2021cac8239fef6337f4d3cbcb0568b4644f29
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(acosf)
58 add_math_entrypoint_object(acoshf)
60 add_math_entrypoint_object(asinf)
61 add_math_entrypoint_object(asinhf)
63 add_math_entrypoint_object(atanf)
65 add_math_entrypoint_object(atanhf)
67 add_math_entrypoint_object(ceil)
68 add_math_entrypoint_object(ceilf)
69 add_math_entrypoint_object(ceill)
71 add_math_entrypoint_object(copysign)
72 add_math_entrypoint_object(copysignf)
73 add_math_entrypoint_object(copysignl)
75 add_math_entrypoint_object(cos)
76 add_math_entrypoint_object(cosf)
77 add_math_entrypoint_object(cosh)
78 add_math_entrypoint_object(coshf)
80 add_math_entrypoint_object(erff)
82 add_math_entrypoint_object(exp)
83 add_math_entrypoint_object(expf)
85 add_math_entrypoint_object(exp2)
86 add_math_entrypoint_object(exp2f)
88 add_math_entrypoint_object(exp10)
89 add_math_entrypoint_object(exp10f)
91 add_math_entrypoint_object(expm1f)
93 add_math_entrypoint_object(fabs)
94 add_math_entrypoint_object(fabsf)
95 add_math_entrypoint_object(fabsl)
97 add_math_entrypoint_object(fdim)
98 add_math_entrypoint_object(fdimf)
99 add_math_entrypoint_object(fdiml)
101 add_math_entrypoint_object(floor)
102 add_math_entrypoint_object(floorf)
103 add_math_entrypoint_object(floorl)
105 add_math_entrypoint_object(fma)
106 add_math_entrypoint_object(fmaf)
108 add_math_entrypoint_object(fmax)
109 add_math_entrypoint_object(fmaxf)
110 add_math_entrypoint_object(fmaxl)
112 add_math_entrypoint_object(fmin)
113 add_math_entrypoint_object(fminf)
114 add_math_entrypoint_object(fminl)
116 add_math_entrypoint_object(fmod)
117 add_math_entrypoint_object(fmodf)
119 add_math_entrypoint_object(frexp)
120 add_math_entrypoint_object(frexpf)
121 add_math_entrypoint_object(frexpl)
123 add_math_entrypoint_object(hypot)
124 add_math_entrypoint_object(hypotf)
126 add_math_entrypoint_object(ilogb)
127 add_math_entrypoint_object(ilogbf)
128 add_math_entrypoint_object(ilogbl)
130 add_math_entrypoint_object(ldexp)
131 add_math_entrypoint_object(ldexpf)
132 add_math_entrypoint_object(ldexpl)
134 add_math_entrypoint_object(log10)
135 add_math_entrypoint_object(log10f)
137 add_math_entrypoint_object(log1p)
138 add_math_entrypoint_object(log1pf)
140 add_math_entrypoint_object(log2)
141 add_math_entrypoint_object(log2f)
143 add_math_entrypoint_object(log)
144 add_math_entrypoint_object(logf)
146 add_math_entrypoint_object(logb)
147 add_math_entrypoint_object(logbf)
148 add_math_entrypoint_object(logbl)
150 add_math_entrypoint_object(llrint)
151 add_math_entrypoint_object(llrintf)
152 add_math_entrypoint_object(llrintl)
154 add_math_entrypoint_object(llround)
155 add_math_entrypoint_object(llroundf)
156 add_math_entrypoint_object(llroundl)
158 add_math_entrypoint_object(lrint)
159 add_math_entrypoint_object(lrintf)
160 add_math_entrypoint_object(lrintl)
162 add_math_entrypoint_object(lround)
163 add_math_entrypoint_object(lroundf)
164 add_math_entrypoint_object(lroundl)
166 add_math_entrypoint_object(modf)
167 add_math_entrypoint_object(modff)
168 add_math_entrypoint_object(modfl)
170 add_math_entrypoint_object(nearbyint)
171 add_math_entrypoint_object(nearbyintf)
172 add_math_entrypoint_object(nearbyintl)
174 add_math_entrypoint_object(nextafter)
175 add_math_entrypoint_object(nextafterf)
176 add_math_entrypoint_object(nextafterl)
178 add_math_entrypoint_object(pow)
179 add_math_entrypoint_object(powf)
181 add_math_entrypoint_object(remainder)
182 add_math_entrypoint_object(remainderf)
183 add_math_entrypoint_object(remainderl)
185 add_math_entrypoint_object(remquo)
186 add_math_entrypoint_object(remquof)
187 add_math_entrypoint_object(remquol)
189 add_math_entrypoint_object(rint)
190 add_math_entrypoint_object(rintf)
191 add_math_entrypoint_object(rintl)
193 add_math_entrypoint_object(round)
194 add_math_entrypoint_object(roundf)
195 add_math_entrypoint_object(roundl)
197 add_math_entrypoint_object(scalbn)
198 add_math_entrypoint_object(scalbnf)
199 add_math_entrypoint_object(scalbnl)
201 add_math_entrypoint_object(sincosf)
203 add_math_entrypoint_object(sin)
204 add_math_entrypoint_object(sinf)
206 add_math_entrypoint_object(sinh)
207 add_math_entrypoint_object(sinhf)
209 add_math_entrypoint_object(sqrt)
210 add_math_entrypoint_object(sqrtf)
211 add_math_entrypoint_object(sqrtl)
213 add_math_entrypoint_object(tan)
214 add_math_entrypoint_object(tanf)
216 add_math_entrypoint_object(tanh)
217 add_math_entrypoint_object(tanhf)
219 add_math_entrypoint_object(trunc)
220 add_math_entrypoint_object(truncf)
221 add_math_entrypoint_object(truncl)