xref: /llvm-project/libc/src/math/CMakeLists.txt (revision ecf4f95c4f55eea0830659654fa264189773a423)
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_math_entrypoint_object(acos)
44add_math_entrypoint_object(acosf)
45add_math_entrypoint_object(acosh)
46add_math_entrypoint_object(acoshf)
47
48add_math_entrypoint_object(asin)
49add_math_entrypoint_object(asinf)
50add_math_entrypoint_object(asinh)
51add_math_entrypoint_object(asinhf)
52
53add_math_entrypoint_object(atan)
54add_math_entrypoint_object(atanf)
55
56add_math_entrypoint_object(atan2)
57add_math_entrypoint_object(atan2f)
58add_math_entrypoint_object(atan2l)
59
60add_math_entrypoint_object(atanh)
61add_math_entrypoint_object(atanhf)
62
63add_math_entrypoint_object(canonicalize)
64add_math_entrypoint_object(canonicalizef)
65add_math_entrypoint_object(canonicalizel)
66add_math_entrypoint_object(canonicalizef16)
67add_math_entrypoint_object(canonicalizef128)
68
69add_math_entrypoint_object(iscanonical)
70add_math_entrypoint_object(iscanonicalf)
71add_math_entrypoint_object(iscanonicall)
72add_math_entrypoint_object(iscanonicalf16)
73add_math_entrypoint_object(iscanonicalf128)
74
75add_math_entrypoint_object(cbrt)
76add_math_entrypoint_object(cbrtf)
77
78add_math_entrypoint_object(ceil)
79add_math_entrypoint_object(ceilf)
80add_math_entrypoint_object(ceill)
81add_math_entrypoint_object(ceilf16)
82add_math_entrypoint_object(ceilf128)
83
84add_math_entrypoint_object(copysign)
85add_math_entrypoint_object(copysignf)
86add_math_entrypoint_object(copysignl)
87add_math_entrypoint_object(copysignf16)
88add_math_entrypoint_object(copysignf128)
89
90add_math_entrypoint_object(cos)
91add_math_entrypoint_object(cosf)
92add_math_entrypoint_object(cosf16)
93
94add_math_entrypoint_object(cosh)
95add_math_entrypoint_object(coshf)
96add_math_entrypoint_object(coshf16)
97
98add_math_entrypoint_object(cospif)
99add_math_entrypoint_object(cospif16)
100
101add_math_entrypoint_object(daddl)
102add_math_entrypoint_object(daddf128)
103add_math_entrypoint_object(ddivl)
104add_math_entrypoint_object(ddivf128)
105add_math_entrypoint_object(dmull)
106add_math_entrypoint_object(dmulf128)
107
108add_math_entrypoint_object(dfmal)
109add_math_entrypoint_object(dfmaf128)
110
111add_math_entrypoint_object(dsqrtl)
112add_math_entrypoint_object(dsqrtf128)
113
114add_math_entrypoint_object(dsubl)
115add_math_entrypoint_object(dsubf128)
116
117add_math_entrypoint_object(erf)
118add_math_entrypoint_object(erff)
119
120add_math_entrypoint_object(exp)
121add_math_entrypoint_object(expf)
122add_math_entrypoint_object(expf16)
123
124add_math_entrypoint_object(exp2)
125add_math_entrypoint_object(exp2f)
126add_math_entrypoint_object(exp2f16)
127
128add_math_entrypoint_object(exp2m1f)
129add_math_entrypoint_object(exp2m1f16)
130
131add_math_entrypoint_object(exp10)
132add_math_entrypoint_object(exp10f)
133add_math_entrypoint_object(exp10f16)
134
135add_math_entrypoint_object(exp10m1f)
136add_math_entrypoint_object(exp10m1f16)
137
138add_math_entrypoint_object(expm1)
139add_math_entrypoint_object(expm1f)
140add_math_entrypoint_object(expm1f16)
141
142add_math_entrypoint_object(f16add)
143add_math_entrypoint_object(f16addf)
144add_math_entrypoint_object(f16addl)
145add_math_entrypoint_object(f16addf128)
146
147add_math_entrypoint_object(f16div)
148add_math_entrypoint_object(f16divf)
149add_math_entrypoint_object(f16divl)
150add_math_entrypoint_object(f16divf128)
151
152add_math_entrypoint_object(f16fma)
153add_math_entrypoint_object(f16fmaf)
154add_math_entrypoint_object(f16fmal)
155add_math_entrypoint_object(f16fmaf128)
156
157add_math_entrypoint_object(f16mul)
158add_math_entrypoint_object(f16mulf)
159add_math_entrypoint_object(f16mull)
160add_math_entrypoint_object(f16mulf128)
161
162add_math_entrypoint_object(f16sqrt)
163add_math_entrypoint_object(f16sqrtf)
164add_math_entrypoint_object(f16sqrtl)
165add_math_entrypoint_object(f16sqrtf128)
166
167add_math_entrypoint_object(fsqrt)
168add_math_entrypoint_object(fsqrtl)
169add_math_entrypoint_object(fsqrtf128)
170
171add_math_entrypoint_object(f16sub)
172add_math_entrypoint_object(f16subf)
173add_math_entrypoint_object(f16subl)
174add_math_entrypoint_object(f16subf128)
175
176add_math_entrypoint_object(fabs)
177add_math_entrypoint_object(fabsf)
178add_math_entrypoint_object(fabsl)
179add_math_entrypoint_object(fabsf16)
180add_math_entrypoint_object(fabsf128)
181
182add_math_entrypoint_object(fadd)
183add_math_entrypoint_object(faddl)
184add_math_entrypoint_object(faddf128)
185
186add_math_entrypoint_object(fdim)
187add_math_entrypoint_object(fdimf)
188add_math_entrypoint_object(fdiml)
189add_math_entrypoint_object(fdimf16)
190add_math_entrypoint_object(fdimf128)
191
192add_math_entrypoint_object(fdiv)
193add_math_entrypoint_object(fdivl)
194add_math_entrypoint_object(fdivf128)
195
196add_math_entrypoint_object(ffma)
197add_math_entrypoint_object(ffmal)
198add_math_entrypoint_object(ffmaf128)
199
200add_math_entrypoint_object(floor)
201add_math_entrypoint_object(floorf)
202add_math_entrypoint_object(floorl)
203add_math_entrypoint_object(floorf16)
204add_math_entrypoint_object(floorf128)
205
206add_math_entrypoint_object(fma)
207add_math_entrypoint_object(fmaf)
208
209add_math_entrypoint_object(fmax)
210add_math_entrypoint_object(fmaxf)
211add_math_entrypoint_object(fmaxl)
212add_math_entrypoint_object(fmaxf128)
213add_math_entrypoint_object(fmaxf16)
214
215add_math_entrypoint_object(fmin)
216add_math_entrypoint_object(fminf)
217add_math_entrypoint_object(fminl)
218add_math_entrypoint_object(fminf128)
219add_math_entrypoint_object(fminf16)
220
221add_math_entrypoint_object(fmaximum)
222add_math_entrypoint_object(fmaximumf)
223add_math_entrypoint_object(fmaximuml)
224add_math_entrypoint_object(fmaximumf16)
225add_math_entrypoint_object(fmaximumf128)
226
227add_math_entrypoint_object(fmaximum_num)
228add_math_entrypoint_object(fmaximum_numf)
229add_math_entrypoint_object(fmaximum_numl)
230add_math_entrypoint_object(fmaximum_numf16)
231add_math_entrypoint_object(fmaximum_numf128)
232
233add_math_entrypoint_object(fmaximum_mag)
234add_math_entrypoint_object(fmaximum_magf)
235add_math_entrypoint_object(fmaximum_magl)
236add_math_entrypoint_object(fmaximum_magf16)
237add_math_entrypoint_object(fmaximum_magf128)
238
239add_math_entrypoint_object(fmaximum_mag_num)
240add_math_entrypoint_object(fmaximum_mag_numf)
241add_math_entrypoint_object(fmaximum_mag_numl)
242add_math_entrypoint_object(fmaximum_mag_numf16)
243add_math_entrypoint_object(fmaximum_mag_numf128)
244
245add_math_entrypoint_object(fminimum)
246add_math_entrypoint_object(fminimumf)
247add_math_entrypoint_object(fminimuml)
248add_math_entrypoint_object(fminimumf16)
249add_math_entrypoint_object(fminimumf128)
250
251add_math_entrypoint_object(fminimum_num)
252add_math_entrypoint_object(fminimum_numf)
253add_math_entrypoint_object(fminimum_numl)
254add_math_entrypoint_object(fminimum_numf16)
255add_math_entrypoint_object(fminimum_numf128)
256
257add_math_entrypoint_object(fminimum_mag)
258add_math_entrypoint_object(fminimum_magf)
259add_math_entrypoint_object(fminimum_magl)
260add_math_entrypoint_object(fminimum_magf16)
261add_math_entrypoint_object(fminimum_magf128)
262
263add_math_entrypoint_object(fminimum_mag_num)
264add_math_entrypoint_object(fminimum_mag_numf)
265add_math_entrypoint_object(fminimum_mag_numl)
266add_math_entrypoint_object(fminimum_mag_numf16)
267add_math_entrypoint_object(fminimum_mag_numf128)
268
269add_math_entrypoint_object(fmul)
270add_math_entrypoint_object(fmull)
271add_math_entrypoint_object(fmulf128)
272
273add_math_entrypoint_object(fmod)
274add_math_entrypoint_object(fmodf)
275add_math_entrypoint_object(fmodl)
276add_math_entrypoint_object(fmodf16)
277add_math_entrypoint_object(fmodf128)
278
279add_math_entrypoint_object(frexp)
280add_math_entrypoint_object(frexpf)
281add_math_entrypoint_object(frexpl)
282add_math_entrypoint_object(frexpf16)
283add_math_entrypoint_object(frexpf128)
284
285add_math_entrypoint_object(fromfp)
286add_math_entrypoint_object(fromfpf)
287add_math_entrypoint_object(fromfpl)
288add_math_entrypoint_object(fromfpf16)
289add_math_entrypoint_object(fromfpf128)
290
291add_math_entrypoint_object(fromfpx)
292add_math_entrypoint_object(fromfpxf)
293add_math_entrypoint_object(fromfpxl)
294add_math_entrypoint_object(fromfpxf16)
295add_math_entrypoint_object(fromfpxf128)
296
297add_math_entrypoint_object(fsub)
298add_math_entrypoint_object(fsubl)
299add_math_entrypoint_object(fsubf128)
300
301add_math_entrypoint_object(getpayload)
302add_math_entrypoint_object(getpayloadf)
303add_math_entrypoint_object(getpayloadl)
304add_math_entrypoint_object(getpayloadf16)
305add_math_entrypoint_object(getpayloadf128)
306
307add_math_entrypoint_object(hypot)
308add_math_entrypoint_object(hypotf)
309
310add_math_entrypoint_object(ilogb)
311add_math_entrypoint_object(ilogbf)
312add_math_entrypoint_object(ilogbl)
313add_math_entrypoint_object(ilogbf16)
314add_math_entrypoint_object(ilogbf128)
315
316add_math_entrypoint_object(isnan)
317add_math_entrypoint_object(isnanf)
318add_math_entrypoint_object(isnanl)
319
320add_math_entrypoint_object(issignaling)
321add_math_entrypoint_object(issignalingf)
322add_math_entrypoint_object(issignalingl)
323add_math_entrypoint_object(issignalingf16)
324add_math_entrypoint_object(issignalingf128)
325
326add_math_entrypoint_object(llogb)
327add_math_entrypoint_object(llogbf)
328add_math_entrypoint_object(llogbl)
329add_math_entrypoint_object(llogbf16)
330add_math_entrypoint_object(llogbf128)
331
332add_math_entrypoint_object(ldexp)
333add_math_entrypoint_object(ldexpf)
334add_math_entrypoint_object(ldexpl)
335add_math_entrypoint_object(ldexpf16)
336add_math_entrypoint_object(ldexpf128)
337
338add_math_entrypoint_object(log10)
339add_math_entrypoint_object(log10f)
340add_math_entrypoint_object(log10f16)
341
342add_math_entrypoint_object(log1p)
343add_math_entrypoint_object(log1pf)
344
345add_math_entrypoint_object(log2)
346add_math_entrypoint_object(log2f)
347add_math_entrypoint_object(log2f16)
348
349add_math_entrypoint_object(log)
350add_math_entrypoint_object(logf)
351add_math_entrypoint_object(logf16)
352
353add_math_entrypoint_object(logb)
354add_math_entrypoint_object(logbf)
355add_math_entrypoint_object(logbl)
356add_math_entrypoint_object(logbf16)
357add_math_entrypoint_object(logbf128)
358
359add_math_entrypoint_object(llrint)
360add_math_entrypoint_object(llrintf)
361add_math_entrypoint_object(llrintl)
362add_math_entrypoint_object(llrintf16)
363add_math_entrypoint_object(llrintf128)
364
365add_math_entrypoint_object(llround)
366add_math_entrypoint_object(llroundf)
367add_math_entrypoint_object(llroundl)
368add_math_entrypoint_object(llroundf16)
369add_math_entrypoint_object(llroundf128)
370
371add_math_entrypoint_object(lrint)
372add_math_entrypoint_object(lrintf)
373add_math_entrypoint_object(lrintl)
374add_math_entrypoint_object(lrintf16)
375add_math_entrypoint_object(lrintf128)
376
377add_math_entrypoint_object(lround)
378add_math_entrypoint_object(lroundf)
379add_math_entrypoint_object(lroundl)
380add_math_entrypoint_object(lroundf16)
381add_math_entrypoint_object(lroundf128)
382
383add_math_entrypoint_object(modf)
384add_math_entrypoint_object(modff)
385add_math_entrypoint_object(modfl)
386add_math_entrypoint_object(modff16)
387add_math_entrypoint_object(modff128)
388
389add_math_entrypoint_object(nan)
390add_math_entrypoint_object(nanf)
391add_math_entrypoint_object(nanl)
392add_math_entrypoint_object(nanf16)
393add_math_entrypoint_object(nanf128)
394
395add_math_entrypoint_object(nearbyint)
396add_math_entrypoint_object(nearbyintf)
397add_math_entrypoint_object(nearbyintl)
398add_math_entrypoint_object(nearbyintf16)
399add_math_entrypoint_object(nearbyintf128)
400
401add_math_entrypoint_object(nextafter)
402add_math_entrypoint_object(nextafterf)
403add_math_entrypoint_object(nextafterl)
404add_math_entrypoint_object(nextafterf16)
405add_math_entrypoint_object(nextafterf128)
406
407add_math_entrypoint_object(nexttoward)
408add_math_entrypoint_object(nexttowardf)
409add_math_entrypoint_object(nexttowardl)
410add_math_entrypoint_object(nexttowardf16)
411
412add_math_entrypoint_object(nextdown)
413add_math_entrypoint_object(nextdownf)
414add_math_entrypoint_object(nextdownl)
415add_math_entrypoint_object(nextdownf16)
416add_math_entrypoint_object(nextdownf128)
417
418add_math_entrypoint_object(nextup)
419add_math_entrypoint_object(nextupf)
420add_math_entrypoint_object(nextupl)
421add_math_entrypoint_object(nextupf16)
422add_math_entrypoint_object(nextupf128)
423
424add_math_entrypoint_object(pow)
425add_math_entrypoint_object(powf)
426add_math_entrypoint_object(powi)
427add_math_entrypoint_object(powif)
428
429add_math_entrypoint_object(remainder)
430add_math_entrypoint_object(remainderf)
431add_math_entrypoint_object(remainderl)
432add_math_entrypoint_object(remainderf16)
433add_math_entrypoint_object(remainderf128)
434
435add_math_entrypoint_object(remquo)
436add_math_entrypoint_object(remquof)
437add_math_entrypoint_object(remquof128)
438add_math_entrypoint_object(remquol)
439add_math_entrypoint_object(remquof16)
440
441add_math_entrypoint_object(rint)
442add_math_entrypoint_object(rintf)
443add_math_entrypoint_object(rintl)
444add_math_entrypoint_object(rintf16)
445add_math_entrypoint_object(rintf128)
446
447add_math_entrypoint_object(round)
448add_math_entrypoint_object(roundf)
449add_math_entrypoint_object(roundl)
450add_math_entrypoint_object(roundf16)
451add_math_entrypoint_object(roundf128)
452
453add_math_entrypoint_object(roundeven)
454add_math_entrypoint_object(roundevenf)
455add_math_entrypoint_object(roundevenl)
456add_math_entrypoint_object(roundevenf16)
457add_math_entrypoint_object(roundevenf128)
458
459add_math_entrypoint_object(scalbln)
460add_math_entrypoint_object(scalblnf)
461add_math_entrypoint_object(scalblnl)
462add_math_entrypoint_object(scalblnf16)
463add_math_entrypoint_object(scalblnf128)
464
465add_math_entrypoint_object(scalbn)
466add_math_entrypoint_object(scalbnf)
467add_math_entrypoint_object(scalbnl)
468add_math_entrypoint_object(scalbnf16)
469add_math_entrypoint_object(scalbnf128)
470
471add_math_entrypoint_object(setpayload)
472add_math_entrypoint_object(setpayloadf)
473add_math_entrypoint_object(setpayloadl)
474add_math_entrypoint_object(setpayloadf16)
475add_math_entrypoint_object(setpayloadf128)
476
477add_math_entrypoint_object(setpayloadsig)
478add_math_entrypoint_object(setpayloadsigf)
479add_math_entrypoint_object(setpayloadsigl)
480add_math_entrypoint_object(setpayloadsigf16)
481add_math_entrypoint_object(setpayloadsigf128)
482
483add_math_entrypoint_object(sincos)
484add_math_entrypoint_object(sincosf)
485
486add_math_entrypoint_object(sin)
487add_math_entrypoint_object(sinf)
488add_math_entrypoint_object(sinf16)
489add_math_entrypoint_object(sinpif)
490add_math_entrypoint_object(sinpif16)
491
492add_math_entrypoint_object(sinh)
493add_math_entrypoint_object(sinhf)
494add_math_entrypoint_object(sinhf16)
495
496add_math_entrypoint_object(sqrt)
497add_math_entrypoint_object(sqrtf)
498add_math_entrypoint_object(sqrtl)
499add_math_entrypoint_object(sqrtf16)
500add_math_entrypoint_object(sqrtf128)
501
502add_math_entrypoint_object(tan)
503add_math_entrypoint_object(tanf)
504add_math_entrypoint_object(tanf16)
505
506add_math_entrypoint_object(tanh)
507add_math_entrypoint_object(tanhf)
508add_math_entrypoint_object(tanhf16)
509add_math_entrypoint_object(tanpif16)
510
511add_math_entrypoint_object(tgamma)
512add_math_entrypoint_object(tgammaf)
513add_math_entrypoint_object(lgamma)
514add_math_entrypoint_object(lgamma_r)
515
516add_math_entrypoint_object(totalorder)
517add_math_entrypoint_object(totalorderf)
518add_math_entrypoint_object(totalorderl)
519add_math_entrypoint_object(totalorderf16)
520add_math_entrypoint_object(totalorderf128)
521
522add_math_entrypoint_object(totalordermag)
523add_math_entrypoint_object(totalordermagf)
524add_math_entrypoint_object(totalordermagl)
525add_math_entrypoint_object(totalordermagf16)
526add_math_entrypoint_object(totalordermagf128)
527
528add_math_entrypoint_object(trunc)
529add_math_entrypoint_object(truncf)
530add_math_entrypoint_object(truncl)
531add_math_entrypoint_object(truncf16)
532add_math_entrypoint_object(truncf128)
533
534add_math_entrypoint_object(ufromfp)
535add_math_entrypoint_object(ufromfpf)
536add_math_entrypoint_object(ufromfpl)
537add_math_entrypoint_object(ufromfpf16)
538add_math_entrypoint_object(ufromfpf128)
539
540add_math_entrypoint_object(ufromfpx)
541add_math_entrypoint_object(ufromfpxf)
542add_math_entrypoint_object(ufromfpxl)
543add_math_entrypoint_object(ufromfpxf16)
544add_math_entrypoint_object(ufromfpxf128)
545