1 2list(APPEND LIBCNTPR_MATH_SOURCE 3 math/abs.c 4 math/div.c 5 math/labs.c 6 math/usermatherr.c 7) 8 9if(ARCH STREQUAL "i386") 10 list(APPEND LIBCNTPR_MATH_SOURCE 11 math/i386/ci.c 12 math/i386/cicos.c 13 math/i386/cilog.c 14 math/i386/cipow.c 15 math/i386/cisin.c 16 math/i386/cisqrt.c 17 math/i386/ldexp.c 18 ) 19 list(APPEND LIBCNTPR_MATH_ASM_SOURCE 20 math/i386/alldiv_asm.s 21 math/i386/alldvrm_asm.s 22 math/i386/allmul_asm.s 23 math/i386/allrem_asm.s 24 math/i386/allshl_asm.s 25 math/i386/allshr_asm.s 26 math/i386/atan_asm.s 27 math/i386/atan2_asm.s 28 math/i386/aulldiv_asm.s 29 math/i386/aulldvrm_asm.s 30 math/i386/aullrem_asm.s 31 math/i386/aullshr_asm.s 32 math/i386/ceil_asm.s 33 math/i386/cos_asm.s 34 math/i386/fabs_asm.s 35 math/i386/floor_asm.s 36 math/i386/ftol_asm.s 37 math/i386/ftol2_asm.s 38 math/i386/log_asm.s 39 math/i386/log10_asm.s 40 math/i386/pow_asm.s 41 math/i386/sin_asm.s 42 math/i386/sqrt_asm.s 43 math/i386/tan_asm.s 44 ) 45 list(APPEND CRT_MATH_ASM_SOURCE 46 math/i386/ceilf.S 47 math/i386/floorf.S 48 math/i386/exp_asm.s 49 math/i386/fmod_asm.s 50 math/i386/fmodf_asm.s 51 ) 52elseif(ARCH STREQUAL "amd64") 53 list(APPEND LIBCNTPR_MATH_SOURCE 54 math/cos.c 55 math/sin.c 56 ) 57 list(APPEND LIBCNTPR_MATH_ASM_SOURCE 58 math/amd64/atan.S 59 math/amd64/atan2.S 60 math/amd64/ceil.S 61 math/amd64/exp.S 62 math/amd64/fabs.S 63 math/amd64/floor.S 64 math/amd64/floorf.S 65 math/amd64/fmod.S 66 math/amd64/ldexp.S 67 math/amd64/log.S 68 math/amd64/log10.S 69 math/amd64/pow.S 70 math/amd64/sqrt.S 71 math/amd64/tan.S 72 ) 73elseif(ARCH STREQUAL "arm") 74 list(APPEND LIBCNTPR_MATH_SOURCE 75 math/cos.c 76 math/floorf.c 77 math/sin.c 78 math/sqrt.c 79 math/arm/__rt_sdiv.c 80 math/arm/__rt_sdiv64_worker.c 81 math/arm/__rt_udiv.c 82 math/arm/__rt_udiv64_worker.c 83 math/arm/__rt_div_worker.h 84 math/arm/__dtoi64.c 85 math/arm/__dtou64.c 86 math/arm/__stoi64.c 87 math/arm/__stou64.c 88 math/arm/__fto64.h 89 ) 90 list(APPEND CRT_MATH_SOURCE 91 math/fabsf.c 92 ) 93 list(APPEND LIBCNTPR_MATH_ASM_SOURCE 94 math/arm/atan.s 95 math/arm/atan2.s 96 math/arm/ceil.s 97 math/arm/exp.s 98 math/arm/fabs.s 99 math/arm/fmod.s 100 math/arm/floor.s 101 math/arm/ldexp.s 102 math/arm/log.s 103 math/arm/log10.s 104 math/arm/pow.s 105 math/arm/tan.s 106 math/arm/__i64tod.s 107 math/arm/__i64tos.s 108 math/arm/__u64tod.s 109 math/arm/__u64tos.s 110 math/arm/__rt_sdiv64.s 111 math/arm/__rt_srsh.s 112 math/arm/__rt_udiv64.s 113 ) 114 list(APPEND CRT_MATH_ASM_SOURCE 115 math/arm/_logb.s 116 ) 117endif() 118 119if(NOT ARCH STREQUAL "i386") 120 list(APPEND CRT_MATH_SOURCE 121 math/_chgsignf.c 122 math/_copysignf.c 123 math/_hypotf.c 124 math/acosf.c 125 math/asinf.c 126 math/atan2f.c 127 math/atanf.c 128 math/ceilf.c 129 math/cos.c 130 math/coshf.c 131 math/expf.c 132 math/fmodf.c 133 math/log10f.c 134 math/modff.c 135 math/sin.c 136 math/sinhf.c 137 math/sqrtf.c 138 math/tanf.c 139 math/tanhf.c 140 math/stubs.c 141 ) 142endif() 143 144list(APPEND CRT_MATH_SOURCE 145 ${LIBCNTPR_MATH_SOURCE} 146 math/acos.c 147 math/adjust.c 148 math/asin.c 149 math/cabs.c 150 math/cosf.c 151 math/cosh.c 152 math/fdivbug.c 153 math/frexp.c 154 math/huge_val.c 155 math/hypot.c 156 math/ieee754/j0_y0.c 157 math/ieee754/j1_y1.c 158 math/ieee754/jn_yn.c 159 math/j0_y0.c 160 math/j1_y1.c 161 math/jn_yn.c 162 math/ldiv.c 163 math/logf.c 164 math/modf.c 165 math/powf.c 166 math/rand.c 167 math/s_modf.c 168 math/sinf.c 169 math/sinh.c 170 math/tanh.c 171) 172 173list(APPEND CRT_MATH_ASM_SOURCE 174 ${LIBCNTPR_MATH_ASM_SOURCE} 175) 176 177list(APPEND LIBCNTPR_MATH_SOURCE 178 math/rand_nt.c 179) 180 181if(ARCH STREQUAL "i386") 182 list(APPEND ATAN2_ASM_SOURCE math/i386/atan2_asm.s) 183elseif(ARCH STREQUAL "amd64") 184 list(APPEND ATAN2_ASM_SOURCE math/amd64/atan2.S) 185elseif(ARCH STREQUAL "arm") 186 list(APPEND ATAN2_ASM_SOURCE math/arm/atan2.s) 187endif() 188 189add_asm_files(atan2_asm ${ATAN2_ASM_SOURCE}) 190add_library(atan2 ${atan2_asm}) 191set_target_properties(atan2 PROPERTIES LINKER_LANGUAGE "C") 192add_dependencies(atan2 asm) 193