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 |
| 47 | ffsdi2.c |
| 48 | ffsti2.c |
| 49 | fixdfdi.c |
| 50 | fixdfsi.c |
| 51 | fixdfti.c |
| 52 | fixsfdi.c |
| 53 | fixsfsi.c |
| 54 | fixsfti.c |
| 55 | fixunsdfdi.c |
| 56 | fixunsdfsi.c |
| 57 | fixunsdfti.c |
| 58 | fixunssfdi.c |
| 59 | fixunssfsi.c |
| 60 | fixunssfti.c |
| 61 | fixunsxfdi.c |
| 62 | fixunsxfsi.c |
| 63 | fixunsxfti.c |
| 64 | fixxfdi.c |
| 65 | fixxfti.c |
| 66 | floatdidf.c |
| 67 | floatdisf.c |
| 68 | floatdixf.c |
| 69 | floatsidf.c |
| 70 | floatsisf.c |
| 71 | floattidf.c |
| 72 | floattisf.c |
| 73 | floattixf.c |
| 74 | floatundidf.c |
| 75 | floatundisf.c |
| 76 | floatundixf.c |
| 77 | floatunsidf.c |
| 78 | floatunsisf.c |
| 79 | floatuntidf.c |
| 80 | floatuntisf.c |
| 81 | floatuntixf.c |
| 82 | gcc_personality_v0.c |
| 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 |
| 127 | truncdfsf2.c |
| 128 | ucmpdi2.c |
| 129 | ucmpti2.c |
| 130 | udivdi3.c |
| 131 | udivmoddi4.c |
| 132 | udivmodsi4.c |
| 133 | udivmodti4.c |
| 134 | udivsi3.c |
| 135 | udivti3.c |
| 136 | umoddi3.c |
| 137 | umodsi3.c |
| 138 | umodti3.c) |
| 139 | |
| 140 | set(x86_64_SOURCES |
| 141 | x86_64/floatdidf.c |
| 142 | x86_64/floatdisf.c |
| 143 | x86_64/floatdixf.c |
| 144 | x86_64/floatundidf.S |
| 145 | x86_64/floatundisf.S |
| 146 | x86_64/floatundixf.S |
| 147 | ${GENERIC_SOURCES}) |
| 148 | |
| 149 | set(i386_SOURCES |
| 150 | i386/ashldi3.S |
| 151 | i386/ashrdi3.S |
| 152 | i386/divdi3.S |
| 153 | i386/floatdidf.S |
| 154 | i386/floatdisf.S |
| 155 | i386/floatdixf.S |
| 156 | i386/floatundidf.S |
| 157 | i386/floatundisf.S |
| 158 | i386/floatundixf.S |
| 159 | i386/lshrdi3.S |
| 160 | i386/moddi3.S |
| 161 | i386/muldi3.S |
| 162 | i386/udivdi3.S |
| 163 | i386/umoddi3.S |
| 164 | ${GENERIC_SOURCES}) |
| 165 | |
| 166 | set(arm_SOURCES |
| 167 | arm/adddf3vfp.S |
| 168 | arm/addsf3vfp.S |
| 169 | arm/aeabi_dcmp.S |
Saleem Abdulrasool | a0a5873 | 2014-09-06 21:34:02 +0000 | [diff] [blame^] | 170 | arm/aeabi_div0.c |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 171 | arm/aeabi_fcmp.S |
| 172 | arm/aeabi_idivmod.S |
| 173 | arm/aeabi_ldivmod.S |
| 174 | arm/aeabi_memcmp.S |
| 175 | arm/aeabi_memcpy.S |
| 176 | arm/aeabi_memmove.S |
| 177 | arm/aeabi_memset.S |
| 178 | arm/aeabi_uidivmod.S |
| 179 | arm/aeabi_uldivmod.S |
| 180 | arm/bswapdi2.S |
| 181 | arm/bswapsi2.S |
| 182 | arm/comparesf2.S |
| 183 | arm/divdf3vfp.S |
| 184 | arm/divmodsi4.S |
| 185 | arm/divsf3vfp.S |
| 186 | arm/divsi3.S |
| 187 | arm/eqdf2vfp.S |
| 188 | arm/eqsf2vfp.S |
| 189 | arm/extendsfdf2vfp.S |
| 190 | arm/fixdfsivfp.S |
| 191 | arm/fixsfsivfp.S |
| 192 | arm/fixunsdfsivfp.S |
| 193 | arm/fixunssfsivfp.S |
| 194 | arm/floatsidfvfp.S |
| 195 | arm/floatsisfvfp.S |
| 196 | arm/floatunssidfvfp.S |
| 197 | arm/floatunssisfvfp.S |
| 198 | arm/gedf2vfp.S |
| 199 | arm/gesf2vfp.S |
| 200 | arm/gtdf2vfp.S |
| 201 | arm/gtsf2vfp.S |
| 202 | arm/ledf2vfp.S |
| 203 | arm/lesf2vfp.S |
| 204 | arm/ltdf2vfp.S |
| 205 | arm/ltsf2vfp.S |
| 206 | arm/modsi3.S |
| 207 | arm/muldf3vfp.S |
| 208 | arm/mulsf3vfp.S |
| 209 | arm/nedf2vfp.S |
| 210 | arm/negdf2vfp.S |
| 211 | arm/negsf2vfp.S |
| 212 | arm/nesf2vfp.S |
| 213 | arm/restore_vfp_d8_d15_regs.S |
| 214 | arm/save_vfp_d8_d15_regs.S |
| 215 | arm/subdf3vfp.S |
| 216 | arm/subsf3vfp.S |
| 217 | arm/switch16.S |
| 218 | arm/switch32.S |
| 219 | arm/switch8.S |
| 220 | arm/switchu8.S |
Tim Northover | 1683caa | 2014-03-04 10:10:17 +0000 | [diff] [blame] | 221 | arm/sync_fetch_and_add_4.S |
| 222 | arm/sync_fetch_and_add_8.S |
| 223 | arm/sync_fetch_and_and_4.S |
| 224 | arm/sync_fetch_and_and_8.S |
| 225 | arm/sync_fetch_and_max_4.S |
| 226 | arm/sync_fetch_and_max_8.S |
| 227 | arm/sync_fetch_and_min_4.S |
| 228 | arm/sync_fetch_and_min_8.S |
| 229 | arm/sync_fetch_and_nand_4.S |
| 230 | arm/sync_fetch_and_nand_8.S |
| 231 | arm/sync_fetch_and_or_4.S |
| 232 | arm/sync_fetch_and_or_8.S |
| 233 | arm/sync_fetch_and_sub_4.S |
| 234 | arm/sync_fetch_and_sub_8.S |
| 235 | arm/sync_fetch_and_umax_4.S |
| 236 | arm/sync_fetch_and_umax_8.S |
| 237 | arm/sync_fetch_and_umin_4.S |
| 238 | arm/sync_fetch_and_umin_8.S |
| 239 | arm/sync_fetch_and_xor_4.S |
| 240 | arm/sync_fetch_and_xor_8.S |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 241 | arm/sync_synchronize.S |
| 242 | arm/truncdfsf2vfp.S |
| 243 | arm/udivmodsi4.S |
| 244 | arm/udivsi3.S |
| 245 | arm/umodsi3.S |
| 246 | arm/unorddf2vfp.S |
| 247 | arm/unordsf2vfp.S |
| 248 | ${GENERIC_SOURCES}) |
| 249 | |
Alexey Samsonov | 63a4af7 | 2014-02-18 09:33:45 +0000 | [diff] [blame] | 250 | add_custom_target(builtins) |
| 251 | |
Alexey Samsonov | a6b264b | 2014-02-14 09:20:33 +0000 | [diff] [blame] | 252 | if (NOT WIN32) |
Saleem Abdulrasool | b72a2fd | 2014-07-26 23:44:22 +0000 | [diff] [blame] | 253 | foreach (arch x86_64 i386 arm) |
| 254 | if (CAN_TARGET_${arch}) |
| 255 | # Filter out generic versions of routines that are re-implemented in |
| 256 | # architecture specific manner. This prevents multiple definitions of the |
| 257 | # same symbols, making the symbol selection non-deterministic. |
| 258 | foreach (_file ${${arch}_SOURCES}) |
| 259 | if (${_file} MATCHES ${arch}/*) |
| 260 | get_filename_component(_name ${_file} NAME) |
| 261 | string(REPLACE ".S" ".c" _cname "${_name}") |
| 262 | list(REMOVE_ITEM ${arch}_SOURCES ${_cname}) |
| 263 | endif () |
| 264 | endforeach () |
| 265 | |
Saleem Abdulrasool | 7618240 | 2014-07-26 04:04:02 +0000 | [diff] [blame] | 266 | set_source_files_properties(${${arch}_SOURCES} PROPERTIES LANGUAGE C) |
Alexey Samsonov | 00997e2 | 2014-05-22 21:12:43 +0000 | [diff] [blame] | 267 | add_compiler_rt_runtime(clang_rt.builtins-${arch} ${arch} STATIC |
Saleem Abdulrasool | b72a2fd | 2014-07-26 23:44:22 +0000 | [diff] [blame] | 268 | SOURCES ${${arch}_SOURCES} |
| 269 | CFLAGS "-std=c99") |
Alexey Samsonov | 00997e2 | 2014-05-22 21:12:43 +0000 | [diff] [blame] | 270 | add_dependencies(builtins clang_rt.builtins-${arch}) |
Saleem Abdulrasool | b72a2fd | 2014-07-26 23:44:22 +0000 | [diff] [blame] | 271 | endif () |
| 272 | endforeach () |
| 273 | endif () |
Alexey Samsonov | 63a4af7 | 2014-02-18 09:33:45 +0000 | [diff] [blame] | 274 | |
| 275 | add_dependencies(compiler-rt builtins) |