llvm-runtime-resources-darwin 0.0.0 → 22.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +33 -0
  3. package/include/__clang_cuda_builtin_vars.h +121 -0
  4. package/include/__clang_cuda_cmath.h +512 -0
  5. package/include/__clang_cuda_complex_builtins.h +229 -0
  6. package/include/__clang_cuda_device_functions.h +1572 -0
  7. package/include/__clang_cuda_intrinsics.h +994 -0
  8. package/include/__clang_cuda_libdevice_declares.h +468 -0
  9. package/include/__clang_cuda_math.h +353 -0
  10. package/include/__clang_cuda_math_forward_declares.h +284 -0
  11. package/include/__clang_cuda_runtime_wrapper.h +522 -0
  12. package/include/__clang_cuda_texture_intrinsics.h +1177 -0
  13. package/include/__clang_hip_cmath.h +848 -0
  14. package/include/__clang_hip_libdevice_declares.h +340 -0
  15. package/include/__clang_hip_math.h +1405 -0
  16. package/include/__clang_hip_runtime_wrapper.h +165 -0
  17. package/include/__clang_hip_stdlib.h +43 -0
  18. package/include/__clang_spirv_builtins.h +217 -0
  19. package/include/__float_float.h +176 -0
  20. package/include/__float_header_macro.h +12 -0
  21. package/include/__float_infinity_nan.h +20 -0
  22. package/include/__stdarg___gnuc_va_list.h +13 -0
  23. package/include/__stdarg___va_copy.h +12 -0
  24. package/include/__stdarg_header_macro.h +12 -0
  25. package/include/__stdarg_va_arg.h +22 -0
  26. package/include/__stdarg_va_copy.h +12 -0
  27. package/include/__stdarg_va_list.h +13 -0
  28. package/include/__stddef_header_macro.h +12 -0
  29. package/include/__stddef_max_align_t.h +27 -0
  30. package/include/__stddef_null.h +29 -0
  31. package/include/__stddef_nullptr_t.h +29 -0
  32. package/include/__stddef_offsetof.h +17 -0
  33. package/include/__stddef_ptrdiff_t.h +20 -0
  34. package/include/__stddef_rsize_t.h +20 -0
  35. package/include/__stddef_size_t.h +20 -0
  36. package/include/__stddef_unreachable.h +21 -0
  37. package/include/__stddef_wchar_t.h +28 -0
  38. package/include/__stddef_wint_t.h +15 -0
  39. package/include/__wmmintrin_aes.h +140 -0
  40. package/include/__wmmintrin_pclmul.h +48 -0
  41. package/include/adcintrin.h +165 -0
  42. package/include/adxintrin.h +107 -0
  43. package/include/altivec.h +19364 -0
  44. package/include/amdgpuintrin.h +191 -0
  45. package/include/ammintrin.h +183 -0
  46. package/include/amo.h +131 -0
  47. package/include/amxavx512intrin.h +596 -0
  48. package/include/amxcomplexintrin.h +167 -0
  49. package/include/amxfp16intrin.h +93 -0
  50. package/include/amxfp8intrin.h +230 -0
  51. package/include/amxintrin.h +492 -0
  52. package/include/amxmovrsintrin.h +48 -0
  53. package/include/amxtf32intrin.h +108 -0
  54. package/include/andes_vector.h +16 -0
  55. package/include/arm64intr.h +35 -0
  56. package/include/arm_acle.h +865 -0
  57. package/include/arm_bf16.h +20 -0
  58. package/include/arm_cde.h +410 -0
  59. package/include/arm_cmse.h +217 -0
  60. package/include/arm_fp16.h +596 -0
  61. package/include/arm_mve.h +19187 -0
  62. package/include/arm_neon.h +74183 -0
  63. package/include/arm_neon_sve_bridge.h +182 -0
  64. package/include/arm_sme.h +3741 -0
  65. package/include/arm_sve.h +32278 -0
  66. package/include/arm_vector_types.h +432 -0
  67. package/include/armintr.h +31 -0
  68. package/include/avx10_2_512bf16intrin.h +568 -0
  69. package/include/avx10_2_512convertintrin.h +322 -0
  70. package/include/avx10_2_512minmaxintrin.h +127 -0
  71. package/include/avx10_2_512niintrin.h +314 -0
  72. package/include/avx10_2_512satcvtdsintrin.h +307 -0
  73. package/include/avx10_2_512satcvtintrin.h +301 -0
  74. package/include/avx10_2bf16intrin.h +1094 -0
  75. package/include/avx10_2convertintrin.h +3257 -0
  76. package/include/avx10_2copyintrin.h +66 -0
  77. package/include/avx10_2minmaxintrin.h +232 -0
  78. package/include/avx10_2niintrin.h +409 -0
  79. package/include/avx10_2satcvtdsintrin.h +376 -0
  80. package/include/avx10_2satcvtintrin.h +312 -0
  81. package/include/avx2intrin.h +5191 -0
  82. package/include/avx512bf16intrin.h +292 -0
  83. package/include/avx512bitalgintrin.h +75 -0
  84. package/include/avx512bwintrin.h +1895 -0
  85. package/include/avx512cdintrin.h +112 -0
  86. package/include/avx512dqintrin.h +1350 -0
  87. package/include/avx512fintrin.h +9378 -0
  88. package/include/avx512fp16intrin.h +3355 -0
  89. package/include/avx512ifmaintrin.h +68 -0
  90. package/include/avx512ifmavlintrin.h +138 -0
  91. package/include/avx512vbmi2intrin.h +368 -0
  92. package/include/avx512vbmiintrin.h +98 -0
  93. package/include/avx512vbmivlintrin.h +179 -0
  94. package/include/avx512vlbf16intrin.h +527 -0
  95. package/include/avx512vlbitalgintrin.h +135 -0
  96. package/include/avx512vlbwintrin.h +3064 -0
  97. package/include/avx512vlcdintrin.h +202 -0
  98. package/include/avx512vldqintrin.h +1156 -0
  99. package/include/avx512vlfp16intrin.h +2090 -0
  100. package/include/avx512vlintrin.h +8083 -0
  101. package/include/avx512vlvbmi2intrin.h +710 -0
  102. package/include/avx512vlvnniintrin.h +313 -0
  103. package/include/avx512vlvp2intersectintrin.h +123 -0
  104. package/include/avx512vnniintrin.h +116 -0
  105. package/include/avx512vp2intersectintrin.h +77 -0
  106. package/include/avx512vpopcntdqintrin.h +62 -0
  107. package/include/avx512vpopcntdqvlintrin.h +105 -0
  108. package/include/avxifmaintrin.h +193 -0
  109. package/include/avxintrin.h +5064 -0
  110. package/include/avxneconvertintrin.h +484 -0
  111. package/include/avxvnniint16intrin.h +451 -0
  112. package/include/avxvnniint8intrin.h +454 -0
  113. package/include/avxvnniintrin.h +233 -0
  114. package/include/bmi2intrin.h +253 -0
  115. package/include/bmiintrin.h +604 -0
  116. package/include/builtins.h +19 -0
  117. package/include/cet.h +66 -0
  118. package/include/cetintrin.h +115 -0
  119. package/include/cldemoteintrin.h +36 -0
  120. package/include/clflushoptintrin.h +36 -0
  121. package/include/clwbintrin.h +38 -0
  122. package/include/clzerointrin.h +38 -0
  123. package/include/cmpccxaddintrin.h +70 -0
  124. package/include/cpuid.h +451 -0
  125. package/include/crc32intrin.h +100 -0
  126. package/include/cuda_wrappers/__utility/declval.h +28 -0
  127. package/include/cuda_wrappers/algorithm +116 -0
  128. package/include/cuda_wrappers/bits/basic_string.h +9 -0
  129. package/include/cuda_wrappers/bits/basic_string.tcc +9 -0
  130. package/include/cuda_wrappers/bits/c++config.h +61 -0
  131. package/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  132. package/include/cuda_wrappers/cmath +44 -0
  133. package/include/cuda_wrappers/complex +90 -0
  134. package/include/cuda_wrappers/new +108 -0
  135. package/include/emmintrin.h +4940 -0
  136. package/include/enqcmdintrin.h +63 -0
  137. package/include/f16cintrin.h +176 -0
  138. package/include/float.h +48 -0
  139. package/include/fma4intrin.h +220 -0
  140. package/include/fmaintrin.h +826 -0
  141. package/include/fuzzer/FuzzedDataProvider.h +397 -0
  142. package/include/fxsrintrin.h +91 -0
  143. package/include/gfniintrin.h +238 -0
  144. package/include/gpuintrin.h +330 -0
  145. package/include/hexagon_circ_brev_intrinsics.h +298 -0
  146. package/include/hexagon_protos.h +8439 -0
  147. package/include/hexagon_types.h +2628 -0
  148. package/include/hresetintrin.h +49 -0
  149. package/include/htmintrin.h +212 -0
  150. package/include/htmxlintrin.h +345 -0
  151. package/include/hvx_hexagon_protos.h +5399 -0
  152. package/include/ia32intrin.h +863 -0
  153. package/include/immintrin.h +595 -0
  154. package/include/intrin.h +491 -0
  155. package/include/intrin0.h +256 -0
  156. package/include/inttypes.h +101 -0
  157. package/include/invpcidintrin.h +23 -0
  158. package/include/iso646.h +31 -0
  159. package/include/keylockerintrin.h +518 -0
  160. package/include/larchintrin.h +260 -0
  161. package/include/lasxintrin.h +3999 -0
  162. package/include/limits.h +133 -0
  163. package/include/llvm_libc_wrappers/assert.h +32 -0
  164. package/include/llvm_libc_wrappers/ctype.h +28 -0
  165. package/include/llvm_libc_wrappers/inttypes.h +32 -0
  166. package/include/llvm_libc_wrappers/stdio.h +52 -0
  167. package/include/llvm_libc_wrappers/stdlib.h +32 -0
  168. package/include/llvm_libc_wrappers/string.h +28 -0
  169. package/include/llvm_libc_wrappers/time.h +28 -0
  170. package/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
  171. package/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
  172. package/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
  173. package/include/lsxintrin.h +3752 -0
  174. package/include/lwpintrin.h +136 -0
  175. package/include/lzcntintrin.h +109 -0
  176. package/include/mm3dnow.h +22 -0
  177. package/include/mm_malloc.h +67 -0
  178. package/include/mmintrin.h +1541 -0
  179. package/include/module.modulemap +360 -0
  180. package/include/movdirintrin.h +49 -0
  181. package/include/movrs_avx10_2_512intrin.h +98 -0
  182. package/include/movrs_avx10_2intrin.h +174 -0
  183. package/include/movrsintrin.h +59 -0
  184. package/include/msa.h +573 -0
  185. package/include/mwaitxintrin.h +62 -0
  186. package/include/nmmintrin.h +20 -0
  187. package/include/nvptxintrin.h +219 -0
  188. package/include/opencl-c-base.h +758 -0
  189. package/include/opencl-c.h +18676 -0
  190. package/include/openmp_wrappers/__clang_openmp_device_functions.h +104 -0
  191. package/include/openmp_wrappers/cmath +132 -0
  192. package/include/openmp_wrappers/complex +55 -0
  193. package/include/openmp_wrappers/complex.h +35 -0
  194. package/include/openmp_wrappers/complex_cmath.h +393 -0
  195. package/include/openmp_wrappers/math.h +61 -0
  196. package/include/openmp_wrappers/new +48 -0
  197. package/include/pconfigintrin.h +40 -0
  198. package/include/pkuintrin.h +34 -0
  199. package/include/pmmintrin.h +302 -0
  200. package/include/popcntintrin.h +59 -0
  201. package/include/ppc_wrappers/bmi2intrin.h +134 -0
  202. package/include/ppc_wrappers/bmiintrin.h +165 -0
  203. package/include/ppc_wrappers/emmintrin.h +2269 -0
  204. package/include/ppc_wrappers/immintrin.h +27 -0
  205. package/include/ppc_wrappers/mm_malloc.h +45 -0
  206. package/include/ppc_wrappers/mmintrin.h +1453 -0
  207. package/include/ppc_wrappers/nmmintrin.h +26 -0
  208. package/include/ppc_wrappers/pmmintrin.h +145 -0
  209. package/include/ppc_wrappers/smmintrin.h +683 -0
  210. package/include/ppc_wrappers/tmmintrin.h +453 -0
  211. package/include/ppc_wrappers/x86gprintrin.h +17 -0
  212. package/include/ppc_wrappers/x86intrin.h +28 -0
  213. package/include/ppc_wrappers/xmmintrin.h +1827 -0
  214. package/include/prfchiintrin.h +61 -0
  215. package/include/prfchwintrin.h +57 -0
  216. package/include/profile/InstrProfData.inc +1001 -0
  217. package/include/profile/instr_prof_interface.h +88 -0
  218. package/include/ptrauth.h +407 -0
  219. package/include/ptwriteintrin.h +37 -0
  220. package/include/raointintrin.h +203 -0
  221. package/include/rdpruintrin.h +57 -0
  222. package/include/rdseedintrin.h +105 -0
  223. package/include/riscv_bitmanip.h +195 -0
  224. package/include/riscv_corev_alu.h +128 -0
  225. package/include/riscv_crypto.h +170 -0
  226. package/include/riscv_mips.h +34 -0
  227. package/include/riscv_nds.h +89 -0
  228. package/include/riscv_ntlh.h +26 -0
  229. package/include/riscv_vector.h +422 -0
  230. package/include/rtmintrin.h +45 -0
  231. package/include/s390intrin.h +25 -0
  232. package/include/sanitizer/allocator_interface.h +106 -0
  233. package/include/sanitizer/asan_interface.h +348 -0
  234. package/include/sanitizer/common_interface_defs.h +544 -0
  235. package/include/sanitizer/coverage_interface.h +36 -0
  236. package/include/sanitizer/dfsan_interface.h +220 -0
  237. package/include/sanitizer/hwasan_interface.h +109 -0
  238. package/include/sanitizer/linux_syscall_hooks.h +3112 -0
  239. package/include/sanitizer/lsan_interface.h +89 -0
  240. package/include/sanitizer/msan_interface.h +135 -0
  241. package/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
  242. package/include/sanitizer/rtsan_interface.h +75 -0
  243. package/include/sanitizer/scudo_interface.h +38 -0
  244. package/include/sanitizer/tsan_interface.h +316 -0
  245. package/include/sanitizer/tsan_interface_atomic.h +223 -0
  246. package/include/sanitizer/ubsan_interface.h +34 -0
  247. package/include/serializeintrin.h +30 -0
  248. package/include/sgxintrin.h +60 -0
  249. package/include/sha512intrin.h +200 -0
  250. package/include/shaintrin.h +190 -0
  251. package/include/sifive_vector.h +174 -0
  252. package/include/sm3intrin.h +238 -0
  253. package/include/sm4evexintrin.h +32 -0
  254. package/include/sm4intrin.h +269 -0
  255. package/include/smmintrin.h +2352 -0
  256. package/include/spirvintrin.h +194 -0
  257. package/include/stdalign.h +24 -0
  258. package/include/stdarg.h +75 -0
  259. package/include/stdatomic.h +204 -0
  260. package/include/stdbool.h +39 -0
  261. package/include/stdckdint.h +42 -0
  262. package/include/stdcountof.h +15 -0
  263. package/include/stddef.h +139 -0
  264. package/include/stddefer.h +19 -0
  265. package/include/stdint.h +844 -0
  266. package/include/stdnoreturn.h +35 -0
  267. package/include/tbmintrin.h +128 -0
  268. package/include/tgmath.h +1368 -0
  269. package/include/tmmintrin.h +779 -0
  270. package/include/tsxldtrkintrin.h +56 -0
  271. package/include/uintrintrin.h +157 -0
  272. package/include/unwind.h +332 -0
  273. package/include/usermsrintrin.h +51 -0
  274. package/include/vadefs.h +51 -0
  275. package/include/vaesintrin.h +86 -0
  276. package/include/varargs.h +16 -0
  277. package/include/vecintrin.h +12868 -0
  278. package/include/velintrin.h +71 -0
  279. package/include/velintrin_approx.h +120 -0
  280. package/include/velintrin_gen.h +1257 -0
  281. package/include/vpclmulqdqintrin.h +30 -0
  282. package/include/waitpkgintrin.h +42 -0
  283. package/include/wasm_simd128.h +2143 -0
  284. package/include/wbnoinvdintrin.h +24 -0
  285. package/include/wmmintrin.h +23 -0
  286. package/include/x86gprintrin.h +49 -0
  287. package/include/x86intrin.h +35 -0
  288. package/include/xmmintrin.h +3175 -0
  289. package/include/xopintrin.h +780 -0
  290. package/include/xsavecintrin.h +84 -0
  291. package/include/xsaveintrin.h +63 -0
  292. package/include/xsaveoptintrin.h +34 -0
  293. package/include/xsavesintrin.h +44 -0
  294. package/include/xtestintrin.h +27 -0
  295. package/include/yvals_core.h +25 -0
  296. package/include/zos_wrappers/builtins.h +18 -0
  297. package/index.js +5 -0
  298. package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
  299. package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
  300. package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
  301. package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
  302. package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  303. package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  304. package/lib/darwin/libclang_rt.cc_kext.a +0 -0
  305. package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
  306. package/lib/darwin/libclang_rt.fuzzer_interceptors_ios.a +0 -0
  307. package/lib/darwin/libclang_rt.fuzzer_interceptors_iossim.a +0 -0
  308. package/lib/darwin/libclang_rt.fuzzer_interceptors_osx.a +0 -0
  309. package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
  310. package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
  311. package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
  312. package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
  313. package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
  314. package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
  315. package/lib/darwin/libclang_rt.ios.a +0 -0
  316. package/lib/darwin/libclang_rt.iossim.a +0 -0
  317. package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
  318. package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
  319. package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
  320. package/lib/darwin/libclang_rt.osx.a +0 -0
  321. package/lib/darwin/libclang_rt.profile_ios.a +0 -0
  322. package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
  323. package/lib/darwin/libclang_rt.profile_osx.a +0 -0
  324. package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
  325. package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
  326. package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
  327. package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
  328. package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
  329. package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
  330. package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
  331. package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
  332. package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
  333. package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
  334. package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
  335. package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
  336. package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
  337. package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
  338. package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
  339. package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
  340. package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  341. package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
  342. package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
  343. package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
  344. package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
  345. package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
  346. package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
  347. package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  348. package/package.json +40 -1
  349. package/share/asan_ignorelist.txt +14 -0
  350. package/share/cfi_ignorelist.txt +17 -0
@@ -0,0 +1,194 @@
1
+ //===-- spirvintrin.h - SPIR-V intrinsic functions ------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __SPIRVINTRIN_H
10
+ #define __SPIRVINTRIN_H
11
+
12
+ #ifndef __SPIRV__
13
+ #error "This file is intended for SPIR-V targets or offloading to SPIR-V"
14
+ #endif
15
+
16
+ #ifndef __GPUINTRIN_H
17
+ #error "Never use <spirvintrin.h> directly; include <gpuintrin.h> instead"
18
+ #endif
19
+
20
+ _Pragma("omp begin declare target device_type(nohost)");
21
+ _Pragma("omp begin declare variant match(device = {arch(spirv64)})");
22
+
23
+ // Type aliases to the address spaces used by the SPIR-V backend.
24
+ #define __gpu_private __attribute__((address_space(0)))
25
+ #define __gpu_constant __attribute__((address_space(2)))
26
+ #define __gpu_local __attribute__((address_space(3)))
27
+ #define __gpu_global __attribute__((address_space(1)))
28
+ #define __gpu_generic __attribute__((address_space(4)))
29
+
30
+ // Attribute to declare a function as a kernel.
31
+ #define __gpu_kernel __attribute__((device_kernel, visibility("protected")))
32
+
33
+ // Returns the number of workgroups in the 'x' dimension of the grid.
34
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_x(void) {
35
+ return __builtin_spirv_num_workgroups(0);
36
+ }
37
+
38
+ // Returns the number of workgroups in the 'y' dimension of the grid.
39
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_y(void) {
40
+ return __builtin_spirv_num_workgroups(1);
41
+ }
42
+
43
+ // Returns the number of workgroups in the 'z' dimension of the grid.
44
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_z(void) {
45
+ return __builtin_spirv_num_workgroups(2);
46
+ }
47
+
48
+ // Returns the 'x' dimension of the current workgroup's id.
49
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_x(void) {
50
+ return __builtin_spirv_workgroup_id(0);
51
+ }
52
+
53
+ // Returns the 'y' dimension of the current workgroup's id.
54
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_y(void) {
55
+ return __builtin_spirv_workgroup_id(1);
56
+ }
57
+
58
+ // Returns the 'z' dimension of the current workgroup's id.
59
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_z(void) {
60
+ return __builtin_spirv_workgroup_id(2);
61
+ }
62
+
63
+ // Returns the number of workitems in the 'x' dimension.
64
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_x(void) {
65
+ return __builtin_spirv_workgroup_size(0);
66
+ }
67
+
68
+ // Returns the number of workitems in the 'y' dimension.
69
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_y(void) {
70
+ return __builtin_spirv_workgroup_size(1);
71
+ }
72
+
73
+ // Returns the number of workitems in the 'z' dimension.
74
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_z(void) {
75
+ return __builtin_spirv_workgroup_size(2);
76
+ }
77
+
78
+ // Returns the 'x' dimension id of the workitem in the current workgroup.
79
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_x(void) {
80
+ return __builtin_spirv_local_invocation_id(0);
81
+ }
82
+
83
+ // Returns the 'y' dimension id of the workitem in the current workgroup.
84
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_y(void) {
85
+ return __builtin_spirv_local_invocation_id(1);
86
+ }
87
+
88
+ // Returns the 'z' dimension id of the workitem in the current workgroup.
89
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_z(void) {
90
+ return __builtin_spirv_local_invocation_id(2);
91
+ }
92
+
93
+ // Returns the size of an wavefront, either 32 or 64 depending on hardware
94
+ // and compilation options.
95
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_lanes(void) {
96
+ return __builtin_spirv_subgroup_size();
97
+ }
98
+
99
+ // Returns the id of the thread inside of an wavefront executing together.
100
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_lane_id(void) {
101
+ return __builtin_spirv_subgroup_local_invocation_id();
102
+ }
103
+
104
+ // Returns the bit-mask of active threads in the current wavefront. This
105
+ // implementation is incorrect if the target uses more than 64 lanes.
106
+ _DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_lane_mask(void) {
107
+ uint32_t [[clang::ext_vector_type(4)]] __mask =
108
+ __builtin_spirv_subgroup_ballot(1);
109
+ return __builtin_bit_cast(uint64_t,
110
+ __builtin_shufflevector(__mask, __mask, 0, 1));
111
+ }
112
+
113
+ // Copies the value from the first active thread in the wavefront to the rest.
114
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t
115
+ __gpu_read_first_lane_u32(uint64_t __lane_mask, uint32_t __x) {
116
+ return __builtin_spirv_subgroup_shuffle(__x,
117
+ __builtin_ctzg(__gpu_lane_mask()));
118
+ }
119
+
120
+ // Returns a bitmask of threads in the current lane for which \p x is true. This
121
+ // implementation is incorrect if the target uses more than 64 lanes.
122
+ _DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_ballot(uint64_t __lane_mask,
123
+ bool __x) {
124
+ // The lane_mask & gives the nvptx semantics when lane_mask is a subset of
125
+ // the active threads.
126
+ uint32_t [[clang::ext_vector_type(4)]] __mask =
127
+ __builtin_spirv_subgroup_ballot(__x);
128
+ return __lane_mask & __builtin_bit_cast(uint64_t, __builtin_shufflevector(
129
+ __mask, __mask, 0, 1));
130
+ }
131
+
132
+ // Waits for all the threads in the block to converge and issues a fence.
133
+ _DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_threads(void) {
134
+ __builtin_spirv_group_barrier();
135
+ }
136
+
137
+ // Wait for all threads in the wavefront to converge, this is a noop on SPIR-V.
138
+ _DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_lane(uint64_t __lane_mask) {
139
+ }
140
+
141
+ // Shuffles the the lanes inside the wavefront according to the given index.
142
+ _DEFAULT_FN_ATTRS static __inline__ uint32_t
143
+ __gpu_shuffle_idx_u32(uint64_t __lane_mask, uint32_t __idx, uint32_t __x,
144
+ uint32_t __width) {
145
+ uint32_t __lane = __idx + (__gpu_lane_id() & ~(__width - 1));
146
+ return __builtin_spirv_subgroup_shuffle(__x, __lane);
147
+ }
148
+
149
+ // Returns a bitmask marking all lanes that have the same value of __x.
150
+ _DEFAULT_FN_ATTRS static __inline__ uint64_t
151
+ __gpu_match_any_u32(uint64_t __lane_mask, uint32_t __x) {
152
+ return __gpu_match_any_u32_impl(__lane_mask, __x);
153
+ }
154
+
155
+ // Returns a bitmask marking all lanes that have the same value of __x.
156
+ _DEFAULT_FN_ATTRS static __inline__ uint64_t
157
+ __gpu_match_any_u64(uint64_t __lane_mask, uint64_t __x) {
158
+ return __gpu_match_any_u64_impl(__lane_mask, __x);
159
+ }
160
+
161
+ // Returns the current lane mask if every lane contains __x.
162
+ _DEFAULT_FN_ATTRS static __inline__ uint64_t
163
+ __gpu_match_all_u32(uint64_t __lane_mask, uint32_t __x) {
164
+ return __gpu_match_all_u32_impl(__lane_mask, __x);
165
+ }
166
+
167
+ // Returns the current lane mask if every lane contains __x.
168
+ _DEFAULT_FN_ATTRS static __inline__ uint64_t
169
+ __gpu_match_all_u64(uint64_t __lane_mask, uint64_t __x) {
170
+ return __gpu_match_all_u64_impl(__lane_mask, __x);
171
+ }
172
+
173
+ // SPIR-V does not expose this, always return false.
174
+ _DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(void *ptr) {
175
+ return 0;
176
+ }
177
+
178
+ // SPIR-V does not expose this, always return false.
179
+ _DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(void *ptr) {
180
+ return 0;
181
+ }
182
+
183
+ // SPIR-V only supports 'OpTerminateInvocation' in fragment shaders.
184
+ _DEFAULT_FN_ATTRS [[noreturn]] static __inline__ void __gpu_exit(void) {
185
+ __builtin_trap();
186
+ }
187
+
188
+ // This is a no-op as SPIR-V does not support it.
189
+ _DEFAULT_FN_ATTRS static __inline__ void __gpu_thread_suspend(void) {}
190
+
191
+ _Pragma("omp end declare variant");
192
+ _Pragma("omp end declare target");
193
+
194
+ #endif // __SPIRVINTRIN_H
@@ -0,0 +1,24 @@
1
+ /*===---- stdalign.h - Standard header for alignment ------------------------===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ #ifndef __STDALIGN_H
11
+ #define __STDALIGN_H
12
+
13
+ #if defined(__cplusplus) || \
14
+ (defined(__STDC_VERSION__) && __STDC_VERSION__ < 202311L)
15
+ #ifndef __cplusplus
16
+ #define alignas _Alignas
17
+ #define alignof _Alignof
18
+ #endif
19
+
20
+ #define __alignas_is_defined 1
21
+ #define __alignof_is_defined 1
22
+ #endif /* __STDC_VERSION__ */
23
+
24
+ #endif /* __STDALIGN_H */
@@ -0,0 +1,75 @@
1
+ /*===---- stdarg.h - Variable argument handling ----------------------------===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ /*
11
+ * This header is designed to be included multiple times. If any of the __need_
12
+ * macros are defined, then only that subset of interfaces are provided. This
13
+ * can be useful for POSIX headers that need to not expose all of stdarg.h, but
14
+ * need to use some of its interfaces. Otherwise this header provides all of
15
+ * the expected interfaces.
16
+ *
17
+ * When clang modules are enabled, this header is a textual header to support
18
+ * the multiple include behavior. As such, it doesn't directly declare anything
19
+ * so that it doesn't add duplicate declarations to all of its includers'
20
+ * modules.
21
+ */
22
+ #if defined(__MVS__) && __has_include_next(<stdarg.h>)
23
+ #undef __need___va_list
24
+ #undef __need_va_list
25
+ #undef __need_va_arg
26
+ #undef __need___va_copy
27
+ #undef __need_va_copy
28
+ #include <__stdarg_header_macro.h>
29
+ #include_next <stdarg.h>
30
+
31
+ #else
32
+ #if !defined(__need___va_list) && !defined(__need_va_list) && \
33
+ !defined(__need_va_arg) && !defined(__need___va_copy) && \
34
+ !defined(__need_va_copy)
35
+ #define __need___va_list
36
+ #define __need_va_list
37
+ #define __need_va_arg
38
+ #define __need___va_copy
39
+ /* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
40
+ * or -ansi is not specified, since it was not part of C90.
41
+ */
42
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
43
+ (defined(__cplusplus) && __cplusplus >= 201103L) || \
44
+ !defined(__STRICT_ANSI__)
45
+ #define __need_va_copy
46
+ #endif
47
+ #include <__stdarg_header_macro.h>
48
+ #endif
49
+
50
+ #ifdef __need___va_list
51
+ #include <__stdarg___gnuc_va_list.h>
52
+ #undef __need___va_list
53
+ #endif /* defined(__need___va_list) */
54
+
55
+ #ifdef __need_va_list
56
+ #include <__stdarg_va_list.h>
57
+ #undef __need_va_list
58
+ #endif /* defined(__need_va_list) */
59
+
60
+ #ifdef __need_va_arg
61
+ #include <__stdarg_va_arg.h>
62
+ #undef __need_va_arg
63
+ #endif /* defined(__need_va_arg) */
64
+
65
+ #ifdef __need___va_copy
66
+ #include <__stdarg___va_copy.h>
67
+ #undef __need___va_copy
68
+ #endif /* defined(__need___va_copy) */
69
+
70
+ #ifdef __need_va_copy
71
+ #include <__stdarg_va_copy.h>
72
+ #undef __need_va_copy
73
+ #endif /* defined(__need_va_copy) */
74
+
75
+ #endif /* __MVS__ */
@@ -0,0 +1,204 @@
1
+ /*===---- stdatomic.h - Standard header for atomic types and operations -----===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ #ifndef __CLANG_STDATOMIC_H
11
+ #define __CLANG_STDATOMIC_H
12
+
13
+ /* If we're hosted, fall back to the system's stdatomic.h. FreeBSD, for
14
+ * example, already has a Clang-compatible stdatomic.h header.
15
+ *
16
+ * Exclude the MSVC path as well as the MSVC header as of the 14.31.30818
17
+ * explicitly disallows `stdatomic.h` in the C mode via an `#error`. Fallback
18
+ * to the clang resource header until that is fully supported. The
19
+ * `stdatomic.h` header requires C++23 or newer.
20
+ */
21
+ #if __STDC_HOSTED__ && \
22
+ __has_include_next(<stdatomic.h>) && \
23
+ (!defined(_MSC_VER) || (defined(__cplusplus) && __cplusplus >= 202002L))
24
+ # include_next <stdatomic.h>
25
+ #else
26
+
27
+ #include <stddef.h>
28
+ #include <stdint.h>
29
+
30
+ #ifdef __cplusplus
31
+ extern "C" {
32
+ #endif
33
+
34
+ /* 7.17.1 Introduction */
35
+
36
+ #define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
37
+ #define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
38
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
39
+ #define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE
40
+ #endif
41
+ #define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
42
+ #define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
43
+ #define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
44
+ #define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
45
+ #define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
46
+ #define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
47
+ #define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
48
+ #define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
49
+
50
+ /* 7.17.2 Initialization */
51
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 202311L) || \
52
+ defined(__cplusplus)
53
+ /* ATOMIC_VAR_INIT was removed in C23, but still remains in C++23. */
54
+ #define ATOMIC_VAR_INIT(value) (value)
55
+ #endif
56
+
57
+ #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201710L && \
58
+ __STDC_VERSION__ < 202311L) || \
59
+ (defined(__cplusplus) && __cplusplus >= 202002L)) && \
60
+ !defined(_CLANG_DISABLE_CRT_DEPRECATION_WARNINGS)
61
+ /* ATOMIC_VAR_INIT was deprecated in C17 and C++20. */
62
+ #pragma clang deprecated(ATOMIC_VAR_INIT)
63
+ #endif
64
+ #define atomic_init __c11_atomic_init
65
+
66
+ /* 7.17.3 Order and consistency */
67
+
68
+ typedef enum memory_order {
69
+ memory_order_relaxed = __ATOMIC_RELAXED,
70
+ memory_order_consume = __ATOMIC_CONSUME,
71
+ memory_order_acquire = __ATOMIC_ACQUIRE,
72
+ memory_order_release = __ATOMIC_RELEASE,
73
+ memory_order_acq_rel = __ATOMIC_ACQ_REL,
74
+ memory_order_seq_cst = __ATOMIC_SEQ_CST
75
+ } memory_order;
76
+
77
+ #define kill_dependency(y) (y)
78
+
79
+ /* 7.17.4 Fences */
80
+
81
+ /* These should be provided by the libc implementation. */
82
+ void atomic_thread_fence(memory_order);
83
+ void atomic_signal_fence(memory_order);
84
+
85
+ #define atomic_thread_fence(order) __c11_atomic_thread_fence(order)
86
+ #define atomic_signal_fence(order) __c11_atomic_signal_fence(order)
87
+
88
+ /* 7.17.5 Lock-free property */
89
+
90
+ #define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj)))
91
+
92
+ /* 7.17.6 Atomic integer types */
93
+
94
+ #ifdef __cplusplus
95
+ typedef _Atomic(bool) atomic_bool;
96
+ #else
97
+ typedef _Atomic(_Bool) atomic_bool;
98
+ #endif
99
+ typedef _Atomic(char) atomic_char;
100
+ typedef _Atomic(signed char) atomic_schar;
101
+ typedef _Atomic(unsigned char) atomic_uchar;
102
+ typedef _Atomic(short) atomic_short;
103
+ typedef _Atomic(unsigned short) atomic_ushort;
104
+ typedef _Atomic(int) atomic_int;
105
+ typedef _Atomic(unsigned int) atomic_uint;
106
+ typedef _Atomic(long) atomic_long;
107
+ typedef _Atomic(unsigned long) atomic_ulong;
108
+ typedef _Atomic(long long) atomic_llong;
109
+ typedef _Atomic(unsigned long long) atomic_ullong;
110
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
111
+ typedef _Atomic(unsigned char) atomic_char8_t;
112
+ #endif
113
+ typedef _Atomic(uint_least16_t) atomic_char16_t;
114
+ typedef _Atomic(uint_least32_t) atomic_char32_t;
115
+ typedef _Atomic(wchar_t) atomic_wchar_t;
116
+ typedef _Atomic(int_least8_t) atomic_int_least8_t;
117
+ typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
118
+ typedef _Atomic(int_least16_t) atomic_int_least16_t;
119
+ typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
120
+ typedef _Atomic(int_least32_t) atomic_int_least32_t;
121
+ typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
122
+ typedef _Atomic(int_least64_t) atomic_int_least64_t;
123
+ typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
124
+ typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
125
+ typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
126
+ typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
127
+ typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
128
+ typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
129
+ typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
130
+ typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
131
+ typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
132
+ typedef _Atomic(intptr_t) atomic_intptr_t;
133
+ typedef _Atomic(uintptr_t) atomic_uintptr_t;
134
+ typedef _Atomic(size_t) atomic_size_t;
135
+ typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
136
+ typedef _Atomic(intmax_t) atomic_intmax_t;
137
+ typedef _Atomic(uintmax_t) atomic_uintmax_t;
138
+
139
+ /* 7.17.7 Operations on atomic types */
140
+
141
+ #define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST)
142
+ #define atomic_store_explicit __c11_atomic_store
143
+
144
+ #define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST)
145
+ #define atomic_load_explicit __c11_atomic_load
146
+
147
+ #define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST)
148
+ #define atomic_exchange_explicit __c11_atomic_exchange
149
+
150
+ #define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
151
+ #define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
152
+
153
+ #define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
154
+ #define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak
155
+
156
+ #define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
157
+ #define atomic_fetch_add_explicit __c11_atomic_fetch_add
158
+
159
+ #define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
160
+ #define atomic_fetch_sub_explicit __c11_atomic_fetch_sub
161
+
162
+ #define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
163
+ #define atomic_fetch_or_explicit __c11_atomic_fetch_or
164
+
165
+ #define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
166
+ #define atomic_fetch_xor_explicit __c11_atomic_fetch_xor
167
+
168
+ #define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
169
+ #define atomic_fetch_and_explicit __c11_atomic_fetch_and
170
+
171
+ /* 7.17.8 Atomic flag type and operations */
172
+
173
+ typedef struct atomic_flag { atomic_bool _Value; } atomic_flag;
174
+
175
+ #ifdef __cplusplus
176
+ #define ATOMIC_FLAG_INIT {false}
177
+ #else
178
+ #define ATOMIC_FLAG_INIT { 0 }
179
+ #endif
180
+
181
+ /* These should be provided by the libc implementation. */
182
+ #ifdef __cplusplus
183
+ bool atomic_flag_test_and_set(volatile atomic_flag *);
184
+ bool atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order);
185
+ #else
186
+ _Bool atomic_flag_test_and_set(volatile atomic_flag *);
187
+ _Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order);
188
+ #endif
189
+ void atomic_flag_clear(volatile atomic_flag *);
190
+ void atomic_flag_clear_explicit(volatile atomic_flag *, memory_order);
191
+
192
+ #define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST)
193
+ #define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order)
194
+
195
+ #define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST)
196
+ #define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order)
197
+
198
+ #ifdef __cplusplus
199
+ }
200
+ #endif
201
+
202
+ #endif /* __STDC_HOSTED__ */
203
+ #endif /* __CLANG_STDATOMIC_H */
204
+
@@ -0,0 +1,39 @@
1
+ /*===---- stdbool.h - Standard header for booleans -------------------------===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ #ifndef __STDBOOL_H
11
+ #define __STDBOOL_H
12
+
13
+ #define __bool_true_false_are_defined 1
14
+
15
+ #if defined(__MVS__) && __has_include_next(<stdbool.h>)
16
+ #include_next <stdbool.h>
17
+ #else
18
+
19
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ > 201710L
20
+ /* FIXME: We should be issuing a deprecation warning here, but cannot yet due
21
+ * to system headers which include this header file unconditionally.
22
+ */
23
+ #elif !defined(__cplusplus)
24
+ #define bool _Bool
25
+ #define true 1
26
+ #define false 0
27
+ #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
28
+ /* Define _Bool as a GNU extension. */
29
+ #define _Bool bool
30
+ #if defined(__cplusplus) && __cplusplus < 201103L
31
+ /* For C++98, define bool, false, true as a GNU extension. */
32
+ #define bool bool
33
+ #define false false
34
+ #define true true
35
+ #endif
36
+ #endif
37
+
38
+ #endif /* __MVS__ */
39
+ #endif /* __STDBOOL_H */
@@ -0,0 +1,42 @@
1
+ /*===---- stdckdint.h - Standard header for checking integer----------------===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ #ifndef __STDCKDINT_H
11
+ #define __STDCKDINT_H
12
+
13
+ /* If we're hosted, fall back to the system's stdckdint.h. FreeBSD, for
14
+ * example, already has a Clang-compatible stdckdint.h header.
15
+ *
16
+ * The `stdckdint.h` header requires C 23 or newer.
17
+ */
18
+ #if __STDC_HOSTED__ && __has_include_next(<stdckdint.h>)
19
+ #include_next <stdckdint.h>
20
+ #else
21
+
22
+ /* C23 7.20.1 Defines several macros for performing checked integer arithmetic*/
23
+
24
+ #define __STDC_VERSION_STDCKDINT_H__ 202311L
25
+
26
+ // Both A and B shall be any integer type other than "plain" char, bool, a bit-
27
+ // precise integer type, or an enumerated type, and they need not be the same.
28
+
29
+ // R shall be a modifiable lvalue of any integer type other than "plain" char,
30
+ // bool, a bit-precise integer type, or an enumerated type. It shouldn't be
31
+ // short type, either. Otherwise, it may be unable to hold two the result of
32
+ // operating two 'int's.
33
+
34
+ // A diagnostic message will be produced if A or B are not suitable integer
35
+ // types, or if R is not a modifiable lvalue of a suitable integer type or R
36
+ // is short type.
37
+ #define ckd_add(R, A, B) __builtin_add_overflow((A), (B), (R))
38
+ #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
39
+ #define ckd_mul(R, A, B) __builtin_mul_overflow((A), (B), (R))
40
+
41
+ #endif /* __STDC_HOSTED__ */
42
+ #endif /* __STDCKDINT_H */
@@ -0,0 +1,15 @@
1
+ /*===---- stdcountof.h - Standard header for countof -----------------------===
2
+ *
3
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ * See https://llvm.org/LICENSE.txt for license information.
5
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ *
7
+ *===-----------------------------------------------------------------------===
8
+ */
9
+
10
+ #ifndef __STDCOUNTOF_H
11
+ #define __STDCOUNTOF_H
12
+
13
+ #define countof _Countof
14
+
15
+ #endif /* __STDCOUNTOF_H */