1add_subdirectory(generic)
2if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_MACHINE})
3  add_subdirectory(${LIBC_TARGET_MACHINE})
4endif()
5
6function(add_math_entrypoint_object name)
7  # We prefer machine specific implementation if available. Hence we check
8  # that first and retrun early if we are able to add an alias target for the
9  # machine specific implementation.
10  get_fq_target_name("${LIBC_TARGET_MACHINE}.${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_MACHINE}.${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  message(FATAL_ERROR "No machine specific or generic implementation found for ${name}.")
33endfunction()
34
35add_math_entrypoint_object(ceil)
36add_math_entrypoint_object(ceilf)
37add_math_entrypoint_object(ceill)
38
39add_math_entrypoint_object(copysign)
40add_math_entrypoint_object(copysignf)
41add_math_entrypoint_object(copysignl)
42
43add_math_entrypoint_object(cosf)
44
45add_math_entrypoint_object(expf)
46
47add_math_entrypoint_object(exp2f)
48
49add_math_entrypoint_object(fabs)
50add_math_entrypoint_object(fabsf)
51add_math_entrypoint_object(fabsl)
52
53add_math_entrypoint_object(fdim)
54add_math_entrypoint_object(fdimf)
55add_math_entrypoint_object(fdiml)
56
57add_math_entrypoint_object(floor)
58add_math_entrypoint_object(floorf)
59add_math_entrypoint_object(floorl)
60
61add_math_entrypoint_object(fmaf)
62
63add_math_entrypoint_object(fmax)
64add_math_entrypoint_object(fmaxf)
65add_math_entrypoint_object(fmaxl)
66
67add_math_entrypoint_object(fmin)
68add_math_entrypoint_object(fminf)
69add_math_entrypoint_object(fminl)
70
71add_math_entrypoint_object(frexp)
72add_math_entrypoint_object(frexpf)
73add_math_entrypoint_object(frexpl)
74
75add_math_entrypoint_object(hypot)
76add_math_entrypoint_object(hypotf)
77
78add_math_entrypoint_object(ilogb)
79add_math_entrypoint_object(ilogbf)
80add_math_entrypoint_object(ilogbl)
81
82add_math_entrypoint_object(ldexp)
83add_math_entrypoint_object(ldexpf)
84add_math_entrypoint_object(ldexpl)
85
86add_math_entrypoint_object(logb)
87add_math_entrypoint_object(logbf)
88add_math_entrypoint_object(logbl)
89
90add_math_entrypoint_object(llrint)
91add_math_entrypoint_object(llrintf)
92add_math_entrypoint_object(llrintl)
93
94add_math_entrypoint_object(llround)
95add_math_entrypoint_object(llroundf)
96add_math_entrypoint_object(llroundl)
97
98add_math_entrypoint_object(lrint)
99add_math_entrypoint_object(lrintf)
100add_math_entrypoint_object(lrintl)
101
102add_math_entrypoint_object(lround)
103add_math_entrypoint_object(lroundf)
104add_math_entrypoint_object(lroundl)
105
106add_math_entrypoint_object(modf)
107add_math_entrypoint_object(modff)
108add_math_entrypoint_object(modfl)
109
110add_math_entrypoint_object(nearbyint)
111add_math_entrypoint_object(nearbyintf)
112add_math_entrypoint_object(nearbyintl)
113
114add_math_entrypoint_object(nextafter)
115add_math_entrypoint_object(nextafterf)
116add_math_entrypoint_object(nextafterl)
117
118add_math_entrypoint_object(remainder)
119add_math_entrypoint_object(remainderf)
120add_math_entrypoint_object(remainderl)
121
122add_math_entrypoint_object(remquo)
123add_math_entrypoint_object(remquof)
124add_math_entrypoint_object(remquol)
125
126add_math_entrypoint_object(rint)
127add_math_entrypoint_object(rintf)
128add_math_entrypoint_object(rintl)
129
130add_math_entrypoint_object(round)
131add_math_entrypoint_object(roundf)
132add_math_entrypoint_object(roundl)
133
134add_math_entrypoint_object(sincosf)
135
136add_math_entrypoint_object(sinf)
137
138add_math_entrypoint_object(sqrt)
139add_math_entrypoint_object(sqrtf)
140add_math_entrypoint_object(sqrtl)
141
142add_math_entrypoint_object(trunc)
143add_math_entrypoint_object(truncf)
144add_math_entrypoint_object(truncl)
145