Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 1 | # This directory contains a large amount of C code which provides |
| 2 | # generic implementations of the core runtime library along with optimized |
| 3 | # architecture-specific code in various subdirectories. |
| 4 | |
| 5 | set(GENERIC_SOURCES |
| 6 | absvdi2.c |
| 7 | absvsi2.c |
| 8 | absvti2.c |
| 9 | adddf3.c |
| 10 | addsf3.c |
Joerg Sonnenberger | 361519f | 2014-06-19 20:24:49 +0000 | [diff] [blame] | 11 | addtf3.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 12 | addvdi3.c |
| 13 | addvsi3.c |
| 14 | addvti3.c |
| 15 | apple_versioning.c |
| 16 | ashldi3.c |
| 17 | ashlti3.c |
| 18 | ashrdi3.c |
| 19 | ashrti3.c |
| 20 | # FIXME: atomic.c may only be compiled if host compiler understands _Atomic |
| 21 | # atomic.c |
| 22 | clear_cache.c |
| 23 | clzdi2.c |
| 24 | clzsi2.c |
| 25 | clzti2.c |
| 26 | cmpdi2.c |
| 27 | cmpti2.c |
| 28 | comparedf2.c |
| 29 | comparesf2.c |
| 30 | ctzdi2.c |
| 31 | ctzsi2.c |
| 32 | ctzti2.c |
| 33 | divdc3.c |
| 34 | divdf3.c |
| 35 | divdi3.c |
| 36 | divmoddi4.c |
| 37 | divmodsi4.c |
| 38 | divsc3.c |
| 39 | divsf3.c |
| 40 | divsi3.c |
| 41 | divti3.c |
Joerg Sonnenberger | 361519f | 2014-06-19 20:24:49 +0000 | [diff] [blame] | 42 | divtf3.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 43 | divxc3.c |
| 44 | enable_execute_stack.c |
| 45 | eprintf.c |
| 46 | extendsfdf2.c |
Ahmed Bougacha | f1ac850 | 2015-05-12 18:33:42 +0000 | [diff] [blame] | 47 | extendhfsf2.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 48 | ffsdi2.c |
| 49 | ffsti2.c |
| 50 | fixdfdi.c |
| 51 | fixdfsi.c |
| 52 | fixdfti.c |
| 53 | fixsfdi.c |
| 54 | fixsfsi.c |
| 55 | fixsfti.c |
| 56 | fixunsdfdi.c |
| 57 | fixunsdfsi.c |
| 58 | fixunsdfti.c |
| 59 | fixunssfdi.c |
| 60 | fixunssfsi.c |
| 61 | fixunssfti.c |
| 62 | fixunsxfdi.c |
| 63 | fixunsxfsi.c |
| 64 | fixunsxfti.c |
| 65 | fixxfdi.c |
| 66 | fixxfti.c |
| 67 | floatdidf.c |
| 68 | floatdisf.c |
| 69 | floatdixf.c |
| 70 | floatsidf.c |
| 71 | floatsisf.c |
| 72 | floattidf.c |
| 73 | floattisf.c |
| 74 | floattixf.c |
| 75 | floatundidf.c |
| 76 | floatundisf.c |
| 77 | floatundixf.c |
| 78 | floatunsidf.c |
| 79 | floatunsisf.c |
| 80 | floatuntidf.c |
| 81 | floatuntisf.c |
| 82 | floatuntixf.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 83 | int_util.c |
| 84 | lshrdi3.c |
| 85 | lshrti3.c |
| 86 | moddi3.c |
| 87 | modsi3.c |
| 88 | modti3.c |
| 89 | muldc3.c |
| 90 | muldf3.c |
| 91 | muldi3.c |
| 92 | mulodi4.c |
| 93 | mulosi4.c |
| 94 | muloti4.c |
| 95 | mulsc3.c |
| 96 | mulsf3.c |
| 97 | multi3.c |
Joerg Sonnenberger | 61d5d38 | 2014-06-19 20:34:03 +0000 | [diff] [blame] | 98 | multf3.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 99 | mulvdi3.c |
| 100 | mulvsi3.c |
| 101 | mulvti3.c |
| 102 | mulxc3.c |
| 103 | negdf2.c |
| 104 | negdi2.c |
| 105 | negsf2.c |
| 106 | negti2.c |
| 107 | negvdi2.c |
| 108 | negvsi2.c |
| 109 | negvti2.c |
| 110 | paritydi2.c |
| 111 | paritysi2.c |
| 112 | parityti2.c |
| 113 | popcountdi2.c |
| 114 | popcountsi2.c |
| 115 | popcountti2.c |
| 116 | powidf2.c |
| 117 | powisf2.c |
| 118 | powitf2.c |
| 119 | powixf2.c |
| 120 | subdf3.c |
| 121 | subsf3.c |
| 122 | subvdi3.c |
| 123 | subvsi3.c |
| 124 | subvti3.c |
Joerg Sonnenberger | 361519f | 2014-06-19 20:24:49 +0000 | [diff] [blame] | 125 | subtf3.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 126 | trampoline_setup.c |
Ahmed Bougacha | f1ac850 | 2015-05-12 18:33:42 +0000 | [diff] [blame] | 127 | truncdfhf2.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 128 | truncdfsf2.c |
Ahmed Bougacha | f1ac850 | 2015-05-12 18:33:42 +0000 | [diff] [blame] | 129 | truncsfhf2.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 130 | ucmpdi2.c |
| 131 | ucmpti2.c |
| 132 | udivdi3.c |
| 133 | udivmoddi4.c |
| 134 | udivmodsi4.c |
| 135 | udivmodti4.c |
| 136 | udivsi3.c |
| 137 | udivti3.c |
| 138 | umoddi3.c |
| 139 | umodsi3.c |
| 140 | umodti3.c) |
| 141 | |
Chris Bieneman | 2a6c132 | 2015-09-23 15:28:44 +0000 | [diff] [blame] | 142 | if(APPLE) |
| 143 | set(GENERIC_SOURCES |
| 144 | ${GENERIC_SOURCES} |
| 145 | atomic_flag_clear.c |
| 146 | atomic_flag_clear_explicit.c |
| 147 | atomic_flag_test_and_set.c |
| 148 | atomic_flag_test_and_set_explicit.c |
| 149 | atomic_signal_fence.c |
| 150 | atomic_thread_fence.c) |
| 151 | endif() |
| 152 | |
Chih-Hung Hsieh | 4814b9c | 2015-08-31 17:14:07 +0000 | [diff] [blame] | 153 | if(NOT WIN32) |
| 154 | set(GENERIC_SOURCES |
| 155 | ${GENERIC_SOURCES} |
| 156 | emutls.c) |
| 157 | endif() |
| 158 | |
Saleem Abdulrasool | a7452e4 | 2015-01-14 15:55:17 +0000 | [diff] [blame] | 159 | if (HAVE_UNWIND_H) |
| 160 | set(GENERIC_SOURCES |
| 161 | ${GENERIC_SOURCES} |
| 162 | gcc_personality_v0.c) |
| 163 | endif () |
| 164 | |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 165 | set(x86_64_SOURCES |
| 166 | x86_64/floatdidf.c |
| 167 | x86_64/floatdisf.c |
| 168 | x86_64/floatdixf.c |
| 169 | x86_64/floatundidf.S |
| 170 | x86_64/floatundisf.S |
| 171 | x86_64/floatundixf.S |
| 172 | ${GENERIC_SOURCES}) |
Chris Bieneman | b38affa | 2015-08-31 21:24:50 +0000 | [diff] [blame] | 173 | set(x86_64h_SOURCES ${x86_64_SOURCES}) |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 174 | |
Reid Kleckner | fbfed86 | 2015-07-17 16:23:05 +0000 | [diff] [blame] | 175 | if(WIN32) |
| 176 | set(x86_64_SOURCES |
| 177 | ${x86_64_SOURCES} |
| 178 | x86_64/chkstk.S) |
| 179 | endif() |
| 180 | |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 181 | set(i386_SOURCES |
| 182 | i386/ashldi3.S |
| 183 | i386/ashrdi3.S |
| 184 | i386/divdi3.S |
| 185 | i386/floatdidf.S |
| 186 | i386/floatdisf.S |
| 187 | i386/floatdixf.S |
| 188 | i386/floatundidf.S |
| 189 | i386/floatundisf.S |
| 190 | i386/floatundixf.S |
| 191 | i386/lshrdi3.S |
| 192 | i386/moddi3.S |
| 193 | i386/muldi3.S |
| 194 | i386/udivdi3.S |
| 195 | i386/umoddi3.S |
| 196 | ${GENERIC_SOURCES}) |
| 197 | |
Reid Kleckner | fbfed86 | 2015-07-17 16:23:05 +0000 | [diff] [blame] | 198 | if(WIN32) |
| 199 | set(i386_SOURCES |
| 200 | ${i386_SOURCES} |
| 201 | i386/chkstk.S) |
| 202 | endif() |
| 203 | |
Evgeniy Stepanov | 0f7ab59 | 2014-10-01 12:55:06 +0000 | [diff] [blame] | 204 | set(i686_SOURCES |
| 205 | ${i386_SOURCES}) |
| 206 | |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 207 | set(arm_SOURCES |
| 208 | arm/adddf3vfp.S |
| 209 | arm/addsf3vfp.S |
Josh Gao | 1108ae0 | 2015-08-21 00:25:37 +0000 | [diff] [blame] | 210 | arm/aeabi_cdcmp.S |
| 211 | arm/aeabi_cdcmpeq_check_nan.c |
| 212 | arm/aeabi_cfcmp.S |
| 213 | arm/aeabi_cfcmpeq_check_nan.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 214 | arm/aeabi_dcmp.S |
Saleem Abdulrasool | a0a5873 | 2014-09-06 21:34:02 +0000 | [diff] [blame] | 215 | arm/aeabi_div0.c |
Dan Albert | b522657 | 2015-08-18 18:10:33 +0000 | [diff] [blame] | 216 | arm/aeabi_drsub.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 217 | arm/aeabi_fcmp.S |
Dan Albert | b522657 | 2015-08-18 18:10:33 +0000 | [diff] [blame] | 218 | arm/aeabi_frsub.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 219 | arm/aeabi_idivmod.S |
| 220 | arm/aeabi_ldivmod.S |
| 221 | arm/aeabi_memcmp.S |
| 222 | arm/aeabi_memcpy.S |
| 223 | arm/aeabi_memmove.S |
| 224 | arm/aeabi_memset.S |
| 225 | arm/aeabi_uidivmod.S |
| 226 | arm/aeabi_uldivmod.S |
| 227 | arm/bswapdi2.S |
| 228 | arm/bswapsi2.S |
| 229 | arm/comparesf2.S |
| 230 | arm/divdf3vfp.S |
| 231 | arm/divmodsi4.S |
| 232 | arm/divsf3vfp.S |
| 233 | arm/divsi3.S |
| 234 | arm/eqdf2vfp.S |
| 235 | arm/eqsf2vfp.S |
| 236 | arm/extendsfdf2vfp.S |
| 237 | arm/fixdfsivfp.S |
| 238 | arm/fixsfsivfp.S |
| 239 | arm/fixunsdfsivfp.S |
| 240 | arm/fixunssfsivfp.S |
| 241 | arm/floatsidfvfp.S |
| 242 | arm/floatsisfvfp.S |
| 243 | arm/floatunssidfvfp.S |
| 244 | arm/floatunssisfvfp.S |
| 245 | arm/gedf2vfp.S |
| 246 | arm/gesf2vfp.S |
| 247 | arm/gtdf2vfp.S |
| 248 | arm/gtsf2vfp.S |
| 249 | arm/ledf2vfp.S |
| 250 | arm/lesf2vfp.S |
| 251 | arm/ltdf2vfp.S |
| 252 | arm/ltsf2vfp.S |
| 253 | arm/modsi3.S |
| 254 | arm/muldf3vfp.S |
| 255 | arm/mulsf3vfp.S |
| 256 | arm/nedf2vfp.S |
| 257 | arm/negdf2vfp.S |
| 258 | arm/negsf2vfp.S |
| 259 | arm/nesf2vfp.S |
| 260 | arm/restore_vfp_d8_d15_regs.S |
| 261 | arm/save_vfp_d8_d15_regs.S |
| 262 | arm/subdf3vfp.S |
| 263 | arm/subsf3vfp.S |
| 264 | arm/switch16.S |
| 265 | arm/switch32.S |
| 266 | arm/switch8.S |
| 267 | arm/switchu8.S |
Tim Northover | 1683caa | 2014-03-04 10:10:17 +0000 | [diff] [blame] | 268 | arm/sync_fetch_and_add_4.S |
| 269 | arm/sync_fetch_and_add_8.S |
| 270 | arm/sync_fetch_and_and_4.S |
| 271 | arm/sync_fetch_and_and_8.S |
| 272 | arm/sync_fetch_and_max_4.S |
| 273 | arm/sync_fetch_and_max_8.S |
| 274 | arm/sync_fetch_and_min_4.S |
| 275 | arm/sync_fetch_and_min_8.S |
| 276 | arm/sync_fetch_and_nand_4.S |
| 277 | arm/sync_fetch_and_nand_8.S |
| 278 | arm/sync_fetch_and_or_4.S |
| 279 | arm/sync_fetch_and_or_8.S |
| 280 | arm/sync_fetch_and_sub_4.S |
| 281 | arm/sync_fetch_and_sub_8.S |
| 282 | arm/sync_fetch_and_umax_4.S |
| 283 | arm/sync_fetch_and_umax_8.S |
| 284 | arm/sync_fetch_and_umin_4.S |
| 285 | arm/sync_fetch_and_umin_8.S |
| 286 | arm/sync_fetch_and_xor_4.S |
| 287 | arm/sync_fetch_and_xor_8.S |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 288 | arm/sync_synchronize.S |
| 289 | arm/truncdfsf2vfp.S |
| 290 | arm/udivmodsi4.S |
| 291 | arm/udivsi3.S |
| 292 | arm/umodsi3.S |
| 293 | arm/unorddf2vfp.S |
| 294 | arm/unordsf2vfp.S |
| 295 | ${GENERIC_SOURCES}) |
| 296 | |
Sergey Dmitrouk | d5a00e8 | 2015-08-18 13:43:37 +0000 | [diff] [blame] | 297 | set(aarch64_SOURCES |
| 298 | comparetf2.c |
| 299 | extenddftf2.c |
| 300 | extendsftf2.c |
| 301 | fixtfdi.c |
| 302 | fixtfsi.c |
| 303 | fixtfti.c |
| 304 | fixunstfdi.c |
| 305 | fixunstfsi.c |
| 306 | fixunstfti.c |
| 307 | floatditf.c |
| 308 | floatsitf.c |
| 309 | floatunditf.c |
| 310 | floatunsitf.c |
| 311 | multc3.c |
| 312 | trunctfdf2.c |
| 313 | trunctfsf2.c |
| 314 | ${GENERIC_SOURCES}) |
| 315 | |
Saleem Abdulrasool | 96c5023 | 2015-09-26 03:26:01 +0000 | [diff] [blame] | 316 | set(armhf_SOURCES ${arm_SOURCES}) |
Chris Bieneman | b38affa | 2015-08-31 21:24:50 +0000 | [diff] [blame] | 317 | set(armv7_SOURCES ${arm_SOURCES}) |
| 318 | set(armv7s_SOURCES ${arm_SOURCES}) |
| 319 | set(arm64_SOURCES ${aarch64_SOURCES}) |
| 320 | |
Chris Bieneman | 6e18e1e | 2015-09-29 23:13:45 +0000 | [diff] [blame] | 321 | # macho_embedded archs |
| 322 | set(armv6m_SOURCES ${GENERIC_SOURCES}) |
| 323 | set(armv7m_SOURCES ${arm_SOURCES}) |
| 324 | set(armv7em_SOURCES ${arm_SOURCES}) |
| 325 | |
Alexey Samsonov | 63a4af7 | 2014-02-18 09:33:45 +0000 | [diff] [blame] | 326 | add_custom_target(builtins) |
| 327 | |
Chris Bieneman | b38affa | 2015-08-31 21:24:50 +0000 | [diff] [blame] | 328 | if (APPLE) |
Chris Bieneman | d868fef | 2015-09-29 23:21:07 +0000 | [diff] [blame^] | 329 | add_subdirectory(Darwin-excludes) |
| 330 | add_subdirectory(macho_embedded) |
Chris Bieneman | 0d42798 | 2015-09-23 15:18:17 +0000 | [diff] [blame] | 331 | darwin_add_builtin_libraries(${BUILTIN_SUPPORTED_OS}) |
Chris Bieneman | b38affa | 2015-08-31 21:24:50 +0000 | [diff] [blame] | 332 | elseif (NOT WIN32 OR MINGW) |
| 333 | foreach (arch ${BUILTIN_SUPPORTED_ARCH}) |
Saleem Abdulrasool | b72a2fd | 2014-07-26 23:44:22 +0000 | [diff] [blame] | 334 | if (CAN_TARGET_${arch}) |
| 335 | # Filter out generic versions of routines that are re-implemented in |
| 336 | # architecture specific manner. This prevents multiple definitions of the |
| 337 | # same symbols, making the symbol selection non-deterministic. |
| 338 | foreach (_file ${${arch}_SOURCES}) |
| 339 | if (${_file} MATCHES ${arch}/*) |
| 340 | get_filename_component(_name ${_file} NAME) |
| 341 | string(REPLACE ".S" ".c" _cname "${_name}") |
| 342 | list(REMOVE_ITEM ${arch}_SOURCES ${_cname}) |
| 343 | endif () |
| 344 | endforeach () |
| 345 | |
Chris Bieneman | d160260 | 2015-08-25 19:53:09 +0000 | [diff] [blame] | 346 | add_compiler_rt_runtime(clang_rt.builtins |
| 347 | STATIC |
Chris Bieneman | b38affa | 2015-08-31 21:24:50 +0000 | [diff] [blame] | 348 | ARCHS ${arch} |
Saleem Abdulrasool | b72a2fd | 2014-07-26 23:44:22 +0000 | [diff] [blame] | 349 | SOURCES ${${arch}_SOURCES} |
Chris Bieneman | d160260 | 2015-08-25 19:53:09 +0000 | [diff] [blame] | 350 | CFLAGS "-std=c99" |
| 351 | PARENT_TARGET builtins) |
Saleem Abdulrasool | b72a2fd | 2014-07-26 23:44:22 +0000 | [diff] [blame] | 352 | endif () |
| 353 | endforeach () |
| 354 | endif () |
Alexey Samsonov | 63a4af7 | 2014-02-18 09:33:45 +0000 | [diff] [blame] | 355 | |
| 356 | add_dependencies(compiler-rt builtins) |