llvm-runtime-resources-darwin 0.0.0 → 23.1.0
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.
- package/LICENSE +201 -0
- package/NOTICE +33 -0
- package/include/__clang_cuda_builtin_vars.h +121 -0
- package/include/__clang_cuda_cmath.h +512 -0
- package/include/__clang_cuda_complex_builtins.h +236 -0
- package/include/__clang_cuda_device_functions.h +1572 -0
- package/include/__clang_cuda_intrinsics.h +975 -0
- package/include/__clang_cuda_libdevice_declares.h +468 -0
- package/include/__clang_cuda_math.h +353 -0
- package/include/__clang_cuda_math_forward_declares.h +289 -0
- package/include/__clang_cuda_runtime_wrapper.h +526 -0
- package/include/__clang_cuda_texture_intrinsics.h +1177 -0
- package/include/__clang_gpu_builtin_vars.h +71 -0
- package/include/__clang_gpu_device_functions.h +411 -0
- package/include/__clang_gpu_intrinsics.h +242 -0
- package/include/__clang_hip_cmath.h +848 -0
- package/include/__clang_hip_libdevice_declares.h +238 -0
- package/include/__clang_hip_math.h +1405 -0
- package/include/__clang_hip_runtime_wrapper.h +170 -0
- package/include/__clang_hip_stdlib.h +43 -0
- package/include/__clang_spirv_builtins.h +217 -0
- package/include/__clang_spirv_libdevice_declares.h +170 -0
- package/include/__clang_spirv_math.h +719 -0
- package/include/__float_float.h +176 -0
- package/include/__float_header_macro.h +12 -0
- package/include/__float_infinity_nan.h +20 -0
- package/include/__stdarg___gnuc_va_list.h +13 -0
- package/include/__stdarg___va_copy.h +12 -0
- package/include/__stdarg_header_macro.h +12 -0
- package/include/__stdarg_va_arg.h +22 -0
- package/include/__stdarg_va_copy.h +12 -0
- package/include/__stdarg_va_list.h +13 -0
- package/include/__stddef_header_macro.h +12 -0
- package/include/__stddef_max_align_t.h +27 -0
- package/include/__stddef_null.h +29 -0
- package/include/__stddef_nullptr_t.h +29 -0
- package/include/__stddef_offsetof.h +17 -0
- package/include/__stddef_ptrdiff_t.h +20 -0
- package/include/__stddef_rsize_t.h +20 -0
- package/include/__stddef_size_t.h +20 -0
- package/include/__stddef_unreachable.h +21 -0
- package/include/__stddef_wchar_t.h +28 -0
- package/include/__stddef_wint_t.h +15 -0
- package/include/__wmmintrin_aes.h +140 -0
- package/include/__wmmintrin_pclmul.h +48 -0
- package/include/adcintrin.h +165 -0
- package/include/adxintrin.h +107 -0
- package/include/altivec.h +19434 -0
- package/include/amdgpuintrin.h +164 -0
- package/include/amdhsa_abi.h +83 -0
- package/include/ammintrin.h +183 -0
- package/include/amo.h +220 -0
- package/include/amxavx512intrin.h +596 -0
- package/include/amxcomplexintrin.h +167 -0
- package/include/amxfp16intrin.h +93 -0
- package/include/amxfp8intrin.h +230 -0
- package/include/amxintrin.h +492 -0
- package/include/amxmovrsintrin.h +48 -0
- package/include/andes_vector.h +21 -0
- package/include/arm64_neon.h +21 -0
- package/include/arm64intr.h +45 -0
- package/include/arm_acle.h +866 -0
- package/include/arm_bf16.h +20 -0
- package/include/arm_cde.h +410 -0
- package/include/arm_cmse.h +217 -0
- package/include/arm_fp16.h +596 -0
- package/include/arm_mve.h +19187 -0
- package/include/arm_neon.h +74351 -0
- package/include/arm_neon_sve_bridge.h +182 -0
- package/include/arm_sme.h +3753 -0
- package/include/arm_sve.h +32698 -0
- package/include/arm_vector_types.h +432 -0
- package/include/armintr.h +31 -0
- package/include/avx10_2_512bf16intrin.h +568 -0
- package/include/avx10_2_512convertintrin.h +322 -0
- package/include/avx10_2_512minmaxintrin.h +127 -0
- package/include/avx10_2_512niintrin.h +314 -0
- package/include/avx10_2_512satcvtdsintrin.h +307 -0
- package/include/avx10_2_512satcvtintrin.h +301 -0
- package/include/avx10_2bf16intrin.h +1094 -0
- package/include/avx10_2convertintrin.h +3257 -0
- package/include/avx10_2copyintrin.h +66 -0
- package/include/avx10_2minmaxintrin.h +232 -0
- package/include/avx10_2niintrin.h +409 -0
- package/include/avx10_2satcvtdsintrin.h +376 -0
- package/include/avx10_2satcvtintrin.h +312 -0
- package/include/avx2intrin.h +5190 -0
- package/include/avx512bf16intrin.h +292 -0
- package/include/avx512bitalgintrin.h +75 -0
- package/include/avx512bmmintrin.h +174 -0
- package/include/avx512bmmvlintrin.h +245 -0
- package/include/avx512bwintrin.h +1885 -0
- package/include/avx512cdintrin.h +112 -0
- package/include/avx512dqintrin.h +1350 -0
- package/include/avx512fintrin.h +9351 -0
- package/include/avx512fp16intrin.h +3349 -0
- package/include/avx512ifmaintrin.h +68 -0
- package/include/avx512ifmavlintrin.h +138 -0
- package/include/avx512vbmi2intrin.h +364 -0
- package/include/avx512vbmiintrin.h +98 -0
- package/include/avx512vbmivlintrin.h +179 -0
- package/include/avx512vlbf16intrin.h +527 -0
- package/include/avx512vlbitalgintrin.h +135 -0
- package/include/avx512vlbwintrin.h +3052 -0
- package/include/avx512vlcdintrin.h +202 -0
- package/include/avx512vldqintrin.h +1156 -0
- package/include/avx512vlfp16intrin.h +2090 -0
- package/include/avx512vlintrin.h +8067 -0
- package/include/avx512vlvbmi2intrin.h +702 -0
- package/include/avx512vlvnniintrin.h +308 -0
- package/include/avx512vlvp2intersectintrin.h +123 -0
- package/include/avx512vnniintrin.h +113 -0
- package/include/avx512vp2intersectintrin.h +77 -0
- package/include/avx512vpopcntdqintrin.h +62 -0
- package/include/avx512vpopcntdqvlintrin.h +105 -0
- package/include/avxifmaintrin.h +193 -0
- package/include/avxintrin.h +5064 -0
- package/include/avxneconvertintrin.h +484 -0
- package/include/avxvnniint16intrin.h +451 -0
- package/include/avxvnniint8intrin.h +454 -0
- package/include/avxvnniintrin.h +238 -0
- package/include/bmi2intrin.h +253 -0
- package/include/bmiintrin.h +604 -0
- package/include/builtins.h +19 -0
- package/include/cet.h +66 -0
- package/include/cetintrin.h +115 -0
- package/include/cldemoteintrin.h +36 -0
- package/include/clflushoptintrin.h +36 -0
- package/include/clwbintrin.h +38 -0
- package/include/clzerointrin.h +38 -0
- package/include/cmpccxaddintrin.h +70 -0
- package/include/cpuid.h +451 -0
- package/include/crc32intrin.h +102 -0
- package/include/cuda_wrappers/__utility/declval.h +28 -0
- package/include/cuda_wrappers/algorithm +116 -0
- package/include/cuda_wrappers/bits/basic_string.h +9 -0
- package/include/cuda_wrappers/bits/basic_string.tcc +9 -0
- package/include/cuda_wrappers/bits/c++config.h +61 -0
- package/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
- package/include/cuda_wrappers/cmath +44 -0
- package/include/cuda_wrappers/complex +90 -0
- package/include/cuda_wrappers/new +108 -0
- package/include/emmintrin.h +4940 -0
- package/include/endian.h +91 -0
- package/include/enqcmdintrin.h +63 -0
- package/include/f16cintrin.h +176 -0
- package/include/float.h +48 -0
- package/include/fma4intrin.h +220 -0
- package/include/fmaintrin.h +826 -0
- package/include/fuzzer/FuzzedDataProvider.h +397 -0
- package/include/fxsrintrin.h +91 -0
- package/include/gfniintrin.h +238 -0
- package/include/gpuintrin.h +348 -0
- package/include/hexagon_circ_brev_intrinsics.h +298 -0
- package/include/hexagon_protos.h +8439 -0
- package/include/hexagon_types.h +2628 -0
- package/include/hlsl_alias_intrinsics_gen.inc +3869 -0
- package/include/hlsl_inline_intrinsics_gen.inc +546 -0
- package/include/hresetintrin.h +49 -0
- package/include/htmintrin.h +212 -0
- package/include/htmxlintrin.h +345 -0
- package/include/hvx_hexagon_protos.h +5421 -0
- package/include/ia32intrin.h +863 -0
- package/include/immintrin.h +597 -0
- package/include/intrin.h +501 -0
- package/include/intrin0.h +256 -0
- package/include/inttypes.h +101 -0
- package/include/invpcidintrin.h +23 -0
- package/include/iso646.h +31 -0
- package/include/keylockerintrin.h +518 -0
- package/include/larchintrin.h +262 -0
- package/include/lasxintrin.h +3999 -0
- package/include/limits.h +133 -0
- package/include/llvm_libc_wrappers/assert.h +32 -0
- package/include/llvm_libc_wrappers/ctype.h +29 -0
- package/include/llvm_libc_wrappers/inttypes.h +32 -0
- package/include/llvm_libc_wrappers/stdio.h +52 -0
- package/include/llvm_libc_wrappers/stdlib.h +32 -0
- package/include/llvm_libc_wrappers/string.h +29 -0
- package/include/llvm_libc_wrappers/time.h +28 -0
- package/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
- package/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
- package/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
- package/include/lsxintrin.h +3752 -0
- package/include/lwpintrin.h +136 -0
- package/include/lzcntintrin.h +109 -0
- package/include/mm3dnow.h +22 -0
- package/include/mm_malloc.h +67 -0
- package/include/mmintrin.h +1541 -0
- package/include/module.modulemap +375 -0
- package/include/movdirintrin.h +49 -0
- package/include/movrs_avx10_2_512intrin.h +98 -0
- package/include/movrs_avx10_2intrin.h +174 -0
- package/include/movrsintrin.h +59 -0
- package/include/msa.h +573 -0
- package/include/mwaitxintrin.h +62 -0
- package/include/nmmintrin.h +20 -0
- package/include/nvptxintrin.h +208 -0
- package/include/opencl-c-base.h +765 -0
- package/include/opencl-c.h +18737 -0
- package/include/openmp_wrappers/__clang_openmp_device_functions.h +118 -0
- package/include/openmp_wrappers/cmath +132 -0
- package/include/openmp_wrappers/complex +61 -0
- package/include/openmp_wrappers/complex.h +41 -0
- package/include/openmp_wrappers/complex_cmath.h +393 -0
- package/include/openmp_wrappers/math.h +71 -0
- package/include/openmp_wrappers/new +48 -0
- package/include/pconfigintrin.h +40 -0
- package/include/pkuintrin.h +34 -0
- package/include/pmmintrin.h +302 -0
- package/include/popcntintrin.h +59 -0
- package/include/ppc_wrappers/bmi2intrin.h +134 -0
- package/include/ppc_wrappers/bmiintrin.h +165 -0
- package/include/ppc_wrappers/emmintrin.h +2269 -0
- package/include/ppc_wrappers/immintrin.h +27 -0
- package/include/ppc_wrappers/mm_malloc.h +45 -0
- package/include/ppc_wrappers/mmintrin.h +1453 -0
- package/include/ppc_wrappers/nmmintrin.h +26 -0
- package/include/ppc_wrappers/pmmintrin.h +145 -0
- package/include/ppc_wrappers/smmintrin.h +683 -0
- package/include/ppc_wrappers/tmmintrin.h +453 -0
- package/include/ppc_wrappers/x86gprintrin.h +17 -0
- package/include/ppc_wrappers/x86intrin.h +28 -0
- package/include/ppc_wrappers/xmmintrin.h +1827 -0
- package/include/prfchiintrin.h +61 -0
- package/include/prfchwintrin.h +57 -0
- package/include/profile/InstrProfData.inc +1063 -0
- package/include/profile/instr_prof_interface.h +88 -0
- package/include/ptrauth.h +485 -0
- package/include/ptwriteintrin.h +37 -0
- package/include/raointintrin.h +203 -0
- package/include/rdpruintrin.h +57 -0
- package/include/rdseedintrin.h +105 -0
- package/include/riscv_bitmanip.h +202 -0
- package/include/riscv_corev_alu.h +130 -0
- package/include/riscv_crypto.h +178 -0
- package/include/riscv_mips.h +36 -0
- package/include/riscv_nds.h +92 -0
- package/include/riscv_ntlh.h +28 -0
- package/include/riscv_packed_simd.h +644 -0
- package/include/riscv_vector.h +465 -0
- package/include/rtmintrin.h +45 -0
- package/include/s390intrin.h +25 -0
- package/include/sanitizer/allocator_interface.h +106 -0
- package/include/sanitizer/asan_interface.h +398 -0
- package/include/sanitizer/common_interface_defs.h +507 -0
- package/include/sanitizer/coverage_interface.h +36 -0
- package/include/sanitizer/dfsan_interface.h +220 -0
- package/include/sanitizer/hwasan_interface.h +109 -0
- package/include/sanitizer/linux_syscall_hooks.h +3112 -0
- package/include/sanitizer/lsan_interface.h +89 -0
- package/include/sanitizer/msan_interface.h +135 -0
- package/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
- package/include/sanitizer/rtsan_interface.h +75 -0
- package/include/sanitizer/safestack_interface.h +50 -0
- package/include/sanitizer/scudo_interface.h +38 -0
- package/include/sanitizer/tsan_interface.h +316 -0
- package/include/sanitizer/tsan_interface_atomic.h +223 -0
- package/include/sanitizer/tysan_interface.h +36 -0
- package/include/sanitizer/ubsan_interface.h +64 -0
- package/include/serializeintrin.h +30 -0
- package/include/sgxintrin.h +60 -0
- package/include/sha512intrin.h +200 -0
- package/include/shaintrin.h +190 -0
- package/include/sifive_vector.h +192 -0
- package/include/sm3intrin.h +238 -0
- package/include/sm4evexintrin.h +32 -0
- package/include/sm4intrin.h +269 -0
- package/include/smmintrin.h +2352 -0
- package/include/spirvintrin.h +167 -0
- package/include/stdalign.h +24 -0
- package/include/stdarg.h +75 -0
- package/include/stdatomic.h +204 -0
- package/include/stdbool.h +39 -0
- package/include/stdckdint.h +42 -0
- package/include/stdcountof.h +15 -0
- package/include/stddef.h +139 -0
- package/include/stddefer.h +19 -0
- package/include/stdint.h +835 -0
- package/include/stdnoreturn.h +35 -0
- package/include/tbmintrin.h +128 -0
- package/include/tgmath.h +1368 -0
- package/include/tmmintrin.h +779 -0
- package/include/tsxldtrkintrin.h +56 -0
- package/include/uintrintrin.h +157 -0
- package/include/unwind.h +332 -0
- package/include/usermsrintrin.h +51 -0
- package/include/vadefs.h +51 -0
- package/include/vaesintrin.h +86 -0
- package/include/varargs.h +16 -0
- package/include/vecintrin.h +12868 -0
- package/include/velintrin.h +71 -0
- package/include/velintrin_approx.h +120 -0
- package/include/velintrin_gen.h +1257 -0
- package/include/vpclmulqdqintrin.h +30 -0
- package/include/waitpkgintrin.h +42 -0
- package/include/wasm_simd128.h +2160 -0
- package/include/wbnoinvdintrin.h +24 -0
- package/include/wmmintrin.h +23 -0
- package/include/x86gprintrin.h +49 -0
- package/include/x86intrin.h +35 -0
- package/include/xmmintrin.h +3176 -0
- package/include/xopintrin.h +780 -0
- package/include/xsavecintrin.h +84 -0
- package/include/xsaveintrin.h +63 -0
- package/include/xsaveoptintrin.h +34 -0
- package/include/xsavesintrin.h +44 -0
- package/include/xtestintrin.h +27 -0
- package/include/yvals_core.h +25 -0
- package/include/zos_wrappers/builtins.h +18 -0
- package/include/zos_wrappers/grp.h +19 -0
- package/include/zos_wrappers/locale.h +19 -0
- package/include/zos_wrappers/math.h +31 -0
- package/include/zos_wrappers/poll.h +19 -0
- package/include/zos_wrappers/stdlib.h +20 -0
- package/include/zos_wrappers/string.h +19 -0
- package/include/zos_wrappers/time.h +19 -0
- package/include/zos_wrappers/variant.h +19 -0
- package/index.js +5 -0
- package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
- package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
- package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
- package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.cc_kext.a +0 -0
- package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_interceptors_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_interceptors_iossim.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_interceptors_osx.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
- package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
- package/lib/darwin/libclang_rt.ios.a +0 -0
- package/lib/darwin/libclang_rt.iossim.a +0 -0
- package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.osx.a +0 -0
- package/lib/darwin/libclang_rt.profile_ios.a +0 -0
- package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
- package/lib/darwin/libclang_rt.profile_osx.a +0 -0
- package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
- package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
- package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
- package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
- package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
- package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
- package/package.json +40 -1
- package/share/asan_ignorelist.txt +14 -0
- package/share/cfi_ignorelist.txt +17 -0
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
// Returns the number of workgroups in the 'x' dimension of the grid.
|
|
31
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_x(void) {
|
|
32
|
+
return __builtin_spirv_num_workgroups(0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Returns the number of workgroups in the 'y' dimension of the grid.
|
|
36
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_y(void) {
|
|
37
|
+
return __builtin_spirv_num_workgroups(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Returns the number of workgroups in the 'z' dimension of the grid.
|
|
41
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_blocks_z(void) {
|
|
42
|
+
return __builtin_spirv_num_workgroups(2);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Returns the 'x' dimension of the current workgroup's id.
|
|
46
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_x(void) {
|
|
47
|
+
return __builtin_spirv_workgroup_id(0);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Returns the 'y' dimension of the current workgroup's id.
|
|
51
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_y(void) {
|
|
52
|
+
return __builtin_spirv_workgroup_id(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Returns the 'z' dimension of the current workgroup's id.
|
|
56
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_z(void) {
|
|
57
|
+
return __builtin_spirv_workgroup_id(2);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Returns the number of workitems in the 'x' dimension.
|
|
61
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_x(void) {
|
|
62
|
+
return __builtin_spirv_workgroup_size(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Returns the number of workitems in the 'y' dimension.
|
|
66
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_y(void) {
|
|
67
|
+
return __builtin_spirv_workgroup_size(1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Returns the number of workitems in the 'z' dimension.
|
|
71
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_threads_z(void) {
|
|
72
|
+
return __builtin_spirv_workgroup_size(2);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Returns the 'x' dimension id of the workitem in the current workgroup.
|
|
76
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_x(void) {
|
|
77
|
+
return __builtin_spirv_local_invocation_id(0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Returns the 'y' dimension id of the workitem in the current workgroup.
|
|
81
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_y(void) {
|
|
82
|
+
return __builtin_spirv_local_invocation_id(1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Returns the 'z' dimension id of the workitem in the current workgroup.
|
|
86
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_z(void) {
|
|
87
|
+
return __builtin_spirv_local_invocation_id(2);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Returns the size of an wavefront, either 32 or 64 depending on hardware
|
|
91
|
+
// and compilation options.
|
|
92
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_num_lanes(void) {
|
|
93
|
+
return __builtin_spirv_subgroup_size();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Returns the id of the thread inside of an wavefront executing together.
|
|
97
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_lane_id(void) {
|
|
98
|
+
return __builtin_spirv_subgroup_local_invocation_id();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Returns the bit-mask of active threads in the current wavefront. This
|
|
102
|
+
// implementation is incorrect if the target uses more than 64 lanes.
|
|
103
|
+
_DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_lane_mask(void) {
|
|
104
|
+
uint32_t [[clang::ext_vector_type(4)]] __mask =
|
|
105
|
+
__builtin_spirv_subgroup_ballot(1);
|
|
106
|
+
return __builtin_bit_cast(uint64_t,
|
|
107
|
+
__builtin_shufflevector(__mask, __mask, 0, 1));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Copies the value from the first active thread in the wavefront to the rest.
|
|
111
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t
|
|
112
|
+
__gpu_read_first_lane_u32(uint64_t __lane_mask, uint32_t __x) {
|
|
113
|
+
return __builtin_spirv_subgroup_shuffle(__x,
|
|
114
|
+
__builtin_ctzg(__gpu_lane_mask()));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Returns a bitmask of threads in the current lane for which \p x is true. This
|
|
118
|
+
// implementation is incorrect if the target uses more than 64 lanes.
|
|
119
|
+
_DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_ballot(uint64_t __lane_mask,
|
|
120
|
+
bool __x) {
|
|
121
|
+
// The lane_mask & gives the nvptx semantics when lane_mask is a subset of
|
|
122
|
+
// the active threads.
|
|
123
|
+
uint32_t [[clang::ext_vector_type(4)]] __mask =
|
|
124
|
+
__builtin_spirv_subgroup_ballot(__x);
|
|
125
|
+
return __lane_mask & __builtin_bit_cast(uint64_t, __builtin_shufflevector(
|
|
126
|
+
__mask, __mask, 0, 1));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Waits for all the threads in the block to converge and issues a fence.
|
|
130
|
+
_DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_threads(void) {
|
|
131
|
+
__builtin_spirv_group_barrier();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Wait for all threads in the wavefront to converge, this is a noop on SPIR-V.
|
|
135
|
+
_DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_lane(uint64_t __lane_mask) {
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Shuffles the the lanes inside the wavefront according to the given index.
|
|
139
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t
|
|
140
|
+
__gpu_shuffle_idx_u32(uint64_t __lane_mask, uint32_t __idx, uint32_t __x,
|
|
141
|
+
uint32_t __width) {
|
|
142
|
+
uint32_t __lane = __idx + (__gpu_lane_id() & ~(__width - 1));
|
|
143
|
+
return __builtin_spirv_subgroup_shuffle(__x, __lane);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// SPIR-V does not expose this, always return false.
|
|
147
|
+
_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(const void *ptr) {
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// SPIR-V does not expose this, always return false.
|
|
152
|
+
_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(const void *ptr) {
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// SPIR-V only supports 'OpTerminateInvocation' in fragment shaders.
|
|
157
|
+
_DEFAULT_FN_ATTRS [[noreturn]] static __inline__ void __gpu_exit(void) {
|
|
158
|
+
__builtin_trap();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// This is a no-op as SPIR-V does not support it.
|
|
162
|
+
_DEFAULT_FN_ATTRS static __inline__ void __gpu_thread_suspend(void) {}
|
|
163
|
+
|
|
164
|
+
_Pragma("omp end declare variant");
|
|
165
|
+
_Pragma("omp end declare target");
|
|
166
|
+
|
|
167
|
+
#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 */
|
package/include/stdarg.h
ADDED
|
@@ -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 */
|