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 libc.src.__support.FPUtil.fma 52 COMPILE_OPTIONS 53 -O3 54) 55 56add_entrypoint_object( 57 fma 58 SRCS 59 fma.cpp 60 HDRS 61 fma.h 62 DEPENDS 63 libc.src.__support.FPUtil.fputil 64 libc.src.__support.FPUtil.fma 65 COMPILE_OPTIONS 66 -O3 67) 68 69add_math_entrypoint_object(ceil) 70add_math_entrypoint_object(ceilf) 71add_math_entrypoint_object(ceill) 72 73add_math_entrypoint_object(copysign) 74add_math_entrypoint_object(copysignf) 75add_math_entrypoint_object(copysignl) 76 77add_math_entrypoint_object(cos) 78add_math_entrypoint_object(cosf) 79 80add_math_entrypoint_object(expf) 81 82add_math_entrypoint_object(exp2f) 83 84add_math_entrypoint_object(expm1f) 85 86add_math_entrypoint_object(fabs) 87add_math_entrypoint_object(fabsf) 88add_math_entrypoint_object(fabsl) 89 90add_math_entrypoint_object(fdim) 91add_math_entrypoint_object(fdimf) 92add_math_entrypoint_object(fdiml) 93 94add_math_entrypoint_object(floor) 95add_math_entrypoint_object(floorf) 96add_math_entrypoint_object(floorl) 97 98add_math_entrypoint_object(fmax) 99add_math_entrypoint_object(fmaxf) 100add_math_entrypoint_object(fmaxl) 101 102add_math_entrypoint_object(fmin) 103add_math_entrypoint_object(fminf) 104add_math_entrypoint_object(fminl) 105 106add_math_entrypoint_object(frexp) 107add_math_entrypoint_object(frexpf) 108add_math_entrypoint_object(frexpl) 109 110add_math_entrypoint_object(hypot) 111add_math_entrypoint_object(hypotf) 112 113add_math_entrypoint_object(ilogb) 114add_math_entrypoint_object(ilogbf) 115add_math_entrypoint_object(ilogbl) 116 117add_math_entrypoint_object(ldexp) 118add_math_entrypoint_object(ldexpf) 119add_math_entrypoint_object(ldexpl) 120 121add_math_entrypoint_object(log10f) 122 123add_math_entrypoint_object(log1pf) 124 125add_math_entrypoint_object(log2f) 126 127add_math_entrypoint_object(logf) 128 129add_math_entrypoint_object(logb) 130add_math_entrypoint_object(logbf) 131add_math_entrypoint_object(logbl) 132 133add_math_entrypoint_object(llrint) 134add_math_entrypoint_object(llrintf) 135add_math_entrypoint_object(llrintl) 136 137add_math_entrypoint_object(llround) 138add_math_entrypoint_object(llroundf) 139add_math_entrypoint_object(llroundl) 140 141add_math_entrypoint_object(lrint) 142add_math_entrypoint_object(lrintf) 143add_math_entrypoint_object(lrintl) 144 145add_math_entrypoint_object(lround) 146add_math_entrypoint_object(lroundf) 147add_math_entrypoint_object(lroundl) 148 149add_math_entrypoint_object(modf) 150add_math_entrypoint_object(modff) 151add_math_entrypoint_object(modfl) 152 153add_math_entrypoint_object(nearbyint) 154add_math_entrypoint_object(nearbyintf) 155add_math_entrypoint_object(nearbyintl) 156 157add_math_entrypoint_object(nextafter) 158add_math_entrypoint_object(nextafterf) 159add_math_entrypoint_object(nextafterl) 160 161add_math_entrypoint_object(remainder) 162add_math_entrypoint_object(remainderf) 163add_math_entrypoint_object(remainderl) 164 165add_math_entrypoint_object(remquo) 166add_math_entrypoint_object(remquof) 167add_math_entrypoint_object(remquol) 168 169add_math_entrypoint_object(rint) 170add_math_entrypoint_object(rintf) 171add_math_entrypoint_object(rintl) 172 173add_math_entrypoint_object(round) 174add_math_entrypoint_object(roundf) 175add_math_entrypoint_object(roundl) 176 177add_math_entrypoint_object(sincosf) 178 179add_math_entrypoint_object(sin) 180add_math_entrypoint_object(sinf) 181 182add_math_entrypoint_object(sqrt) 183add_math_entrypoint_object(sqrtf) 184add_math_entrypoint_object(sqrtl) 185 186add_math_entrypoint_object(tan) 187 188add_math_entrypoint_object(trunc) 189add_math_entrypoint_object(truncf) 190add_math_entrypoint_object(truncl) 191