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,164 @@
|
|
|
1
|
+
//===-- amdgpuintrin.h - AMDPGU 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 __AMDGPUINTRIN_H
|
|
10
|
+
#define __AMDGPUINTRIN_H
|
|
11
|
+
|
|
12
|
+
#ifndef __AMDGPU__
|
|
13
|
+
#error "This file is intended for AMDGPU targets or offloading to AMDGPU"
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#ifndef __GPUINTRIN_H
|
|
17
|
+
#error "Never use <amdgpuintrin.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(amdgcn)})");
|
|
22
|
+
|
|
23
|
+
// Type aliases to the address spaces used by the AMDGPU backend.
|
|
24
|
+
#define __gpu_private __attribute__((address_space(5)))
|
|
25
|
+
#define __gpu_constant __attribute__((address_space(4)))
|
|
26
|
+
#define __gpu_local __attribute__((address_space(3)))
|
|
27
|
+
#define __gpu_global __attribute__((address_space(1)))
|
|
28
|
+
#define __gpu_generic __attribute__((address_space(0)))
|
|
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_amdgcn_grid_size_x() / __builtin_amdgcn_workgroup_size_x();
|
|
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_amdgcn_grid_size_y() / __builtin_amdgcn_workgroup_size_y();
|
|
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_amdgcn_grid_size_z() / __builtin_amdgcn_workgroup_size_z();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Returns the 'x' dimension of the current AMD workgroup's id.
|
|
46
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_x(void) {
|
|
47
|
+
return __builtin_amdgcn_workgroup_id_x();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Returns the 'y' dimension of the current AMD workgroup's id.
|
|
51
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_y(void) {
|
|
52
|
+
return __builtin_amdgcn_workgroup_id_y();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Returns the 'z' dimension of the current AMD workgroup's id.
|
|
56
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_block_id_z(void) {
|
|
57
|
+
return __builtin_amdgcn_workgroup_id_z();
|
|
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_amdgcn_workgroup_size_x();
|
|
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_amdgcn_workgroup_size_y();
|
|
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_amdgcn_workgroup_size_z();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Returns the 'x' dimension id of the workitem in the current AMD workgroup.
|
|
76
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_x(void) {
|
|
77
|
+
return __builtin_amdgcn_workitem_id_x();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Returns the 'y' dimension id of the workitem in the current AMD workgroup.
|
|
81
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_y(void) {
|
|
82
|
+
return __builtin_amdgcn_workitem_id_y();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Returns the 'z' dimension id of the workitem in the current AMD workgroup.
|
|
86
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_thread_id_z(void) {
|
|
87
|
+
return __builtin_amdgcn_workitem_id_z();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Returns the size of an AMD 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_amdgcn_wavefrontsize();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Returns the id of the thread inside of an AMD wavefront executing together.
|
|
97
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t __gpu_lane_id(void) {
|
|
98
|
+
return __builtin_amdgcn_mbcnt_hi(~0u, __builtin_amdgcn_mbcnt_lo(~0u, 0u));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Returns the bit-mask of active threads in the current wavefront.
|
|
102
|
+
_DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_lane_mask(void) {
|
|
103
|
+
return __builtin_amdgcn_read_exec();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Copies the value from the first active thread in the wavefront to the rest.
|
|
107
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t
|
|
108
|
+
__gpu_read_first_lane_u32(uint64_t __lane_mask, uint32_t __x) {
|
|
109
|
+
return __builtin_amdgcn_readfirstlane(__x);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Returns a bitmask of threads in the current lane for which \p x is true.
|
|
113
|
+
_DEFAULT_FN_ATTRS static __inline__ uint64_t __gpu_ballot(uint64_t __lane_mask,
|
|
114
|
+
bool __x) {
|
|
115
|
+
// The lane_mask & gives the nvptx semantics when lane_mask is a subset of
|
|
116
|
+
// the active threads
|
|
117
|
+
return __lane_mask & __builtin_amdgcn_ballot_w64(__x);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Waits for all the threads in the block to converge and issues a fence.
|
|
121
|
+
_DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_threads(void) {
|
|
122
|
+
__builtin_amdgcn_s_barrier();
|
|
123
|
+
__builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "workgroup");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Wait for all threads in the wavefront to converge, this is a noop on AMDGPU.
|
|
127
|
+
_DEFAULT_FN_ATTRS static __inline__ void __gpu_sync_lane(uint64_t __lane_mask) {
|
|
128
|
+
__builtin_amdgcn_wave_barrier();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Shuffles the the lanes inside the wavefront according to the given index.
|
|
132
|
+
_DEFAULT_FN_ATTRS static __inline__ uint32_t
|
|
133
|
+
__gpu_shuffle_idx_u32(uint64_t __lane_mask, uint32_t __idx, uint32_t __x,
|
|
134
|
+
uint32_t __width) {
|
|
135
|
+
uint32_t __lane = __idx + (__gpu_lane_id() & ~(__width - 1));
|
|
136
|
+
return __builtin_amdgcn_ds_bpermute(__lane << 2, __x);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Returns true if the flat pointer points to AMDGPU 'shared' memory.
|
|
140
|
+
_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_local(const void *ptr) {
|
|
141
|
+
return __builtin_amdgcn_is_shared((void [[clang::address_space(0)]] *)((
|
|
142
|
+
void [[clang::opencl_generic]] *)ptr));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Returns true if the flat pointer points to AMDGPU 'private' memory.
|
|
146
|
+
_DEFAULT_FN_ATTRS static __inline__ bool __gpu_is_ptr_private(const void *ptr) {
|
|
147
|
+
return __builtin_amdgcn_is_private((void [[clang::address_space(0)]] *)((
|
|
148
|
+
void [[clang::opencl_generic]] *)ptr));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Terminates execution of the associated wavefront.
|
|
152
|
+
_DEFAULT_FN_ATTRS [[noreturn]] static __inline__ void __gpu_exit(void) {
|
|
153
|
+
__builtin_amdgcn_endpgm();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Suspend the thread briefly to assist the scheduler during busy loops.
|
|
157
|
+
_DEFAULT_FN_ATTRS static __inline__ void __gpu_thread_suspend(void) {
|
|
158
|
+
__builtin_amdgcn_s_sleep(2);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
_Pragma("omp end declare variant");
|
|
162
|
+
_Pragma("omp end declare target");
|
|
163
|
+
|
|
164
|
+
#endif // __AMDGPUINTRIN_H
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
//===-- amdhsa_abi.h - AMDHSA ABI definition utilities --------------------===//
|
|
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 __AMDHSA_ABI_H
|
|
10
|
+
#define __AMDHSA_ABI_H
|
|
11
|
+
|
|
12
|
+
#include <stddef.h>
|
|
13
|
+
#include <stdint.h>
|
|
14
|
+
|
|
15
|
+
typedef struct __attribute__((aligned(8))) amdhsa_implicit_kernarg_v5 {
|
|
16
|
+
uint32_t block_count[3];
|
|
17
|
+
uint16_t group_size[3];
|
|
18
|
+
uint16_t remainder[3];
|
|
19
|
+
char reserved0[16];
|
|
20
|
+
uint64_t global_offset[3];
|
|
21
|
+
uint16_t grid_dims;
|
|
22
|
+
char reserved1[6];
|
|
23
|
+
__attribute__((opencl_global)) void *printf_buffer;
|
|
24
|
+
__attribute__((opencl_global)) void *hostcall_buffer;
|
|
25
|
+
__attribute__((opencl_global)) void *multigrid_sync_arg;
|
|
26
|
+
__attribute__((opencl_global)) void *heap_v1;
|
|
27
|
+
__attribute__((opencl_global)) void *default_queue;
|
|
28
|
+
__attribute__((opencl_global)) void *completion_action;
|
|
29
|
+
char reserved2[72];
|
|
30
|
+
uint32_t private_base; // Unused on gfx9+
|
|
31
|
+
uint32_t shared_base; // Unused on gfx9+
|
|
32
|
+
__attribute__((opencl_global)) void *queue_ptr;
|
|
33
|
+
char reserved3[48];
|
|
34
|
+
} amdhsa_implicit_kernarg_v5;
|
|
35
|
+
|
|
36
|
+
_Static_assert(sizeof(amdhsa_implicit_kernarg_v5) == 256, "wrong struct size");
|
|
37
|
+
|
|
38
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[0]) == 0,
|
|
39
|
+
"wrong offset");
|
|
40
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[1]) == 4,
|
|
41
|
+
"wrong offset");
|
|
42
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, block_count[2]) == 8,
|
|
43
|
+
"wrong offset");
|
|
44
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[0]) == 12,
|
|
45
|
+
"wrong offset");
|
|
46
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[1]) == 14,
|
|
47
|
+
"wrong offset");
|
|
48
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, group_size[2]) == 16,
|
|
49
|
+
"wrong offset");
|
|
50
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[0]) == 18,
|
|
51
|
+
"wrong offset");
|
|
52
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[1]) == 20,
|
|
53
|
+
"wrong offset");
|
|
54
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, remainder[2]) == 22,
|
|
55
|
+
"wrong offset");
|
|
56
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[0]) == 40,
|
|
57
|
+
"wrong offset");
|
|
58
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[1]) == 48,
|
|
59
|
+
"wrong offset");
|
|
60
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, global_offset[2]) == 56,
|
|
61
|
+
"wrong offset");
|
|
62
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, grid_dims) == 64,
|
|
63
|
+
"wrong offset");
|
|
64
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, printf_buffer) == 72,
|
|
65
|
+
"wrong offset");
|
|
66
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, hostcall_buffer) == 80,
|
|
67
|
+
"wrong offset");
|
|
68
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, multigrid_sync_arg) == 88,
|
|
69
|
+
"wrong offset");
|
|
70
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, heap_v1) == 96,
|
|
71
|
+
"wrong offset");
|
|
72
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, default_queue) == 104,
|
|
73
|
+
"wrong offset");
|
|
74
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, completion_action) == 112,
|
|
75
|
+
"wrong offset");
|
|
76
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, private_base) == 192,
|
|
77
|
+
"wrong offset");
|
|
78
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, shared_base) == 196,
|
|
79
|
+
"wrong offset");
|
|
80
|
+
_Static_assert(offsetof(amdhsa_implicit_kernarg_v5, queue_ptr) == 200,
|
|
81
|
+
"wrong offset");
|
|
82
|
+
|
|
83
|
+
#endif // __AMDHSA_ABI_H
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*===---- ammintrin.h - SSE4a intrinsics -----------------------------------===
|
|
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 __AMMINTRIN_H
|
|
11
|
+
#define __AMMINTRIN_H
|
|
12
|
+
|
|
13
|
+
#if !defined(__i386__) && !defined(__x86_64__)
|
|
14
|
+
#error "This header is only meant to be used on x86 and x64 architecture"
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#include <pmmintrin.h>
|
|
18
|
+
|
|
19
|
+
/* Define the default attributes for the functions in this file. */
|
|
20
|
+
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4a"), __min_vector_width__(128)))
|
|
21
|
+
|
|
22
|
+
/// Extracts the specified bits from the lower 64 bits of the 128-bit
|
|
23
|
+
/// integer vector operand at the index \a idx and of the length \a len.
|
|
24
|
+
///
|
|
25
|
+
/// \headerfile <x86intrin.h>
|
|
26
|
+
///
|
|
27
|
+
/// \code
|
|
28
|
+
/// __m128i _mm_extracti_si64(__m128i x, const int len, const int idx);
|
|
29
|
+
/// \endcode
|
|
30
|
+
///
|
|
31
|
+
/// This intrinsic corresponds to the <c> EXTRQ </c> instruction.
|
|
32
|
+
///
|
|
33
|
+
/// \param x
|
|
34
|
+
/// The value from which bits are extracted.
|
|
35
|
+
/// \param len
|
|
36
|
+
/// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0]
|
|
37
|
+
/// are zero, the length is interpreted as 64.
|
|
38
|
+
/// \param idx
|
|
39
|
+
/// Bits [5:0] specify the index of the least significant bit; the other
|
|
40
|
+
/// bits are ignored. If the sum of the index and length is greater than 64,
|
|
41
|
+
/// the result is undefined. If the length and index are both zero, bits
|
|
42
|
+
/// [63:0] of parameter \a x are extracted. If the length is zero but the
|
|
43
|
+
/// index is non-zero, the result is undefined.
|
|
44
|
+
/// \returns A 128-bit integer vector whose lower 64 bits contain the bits
|
|
45
|
+
/// extracted from the source operand.
|
|
46
|
+
#define _mm_extracti_si64(x, len, idx) \
|
|
47
|
+
((__m128i)__builtin_ia32_extrqi((__v2di)(__m128i)(x), \
|
|
48
|
+
(char)(len), (char)(idx)))
|
|
49
|
+
|
|
50
|
+
/// Extracts the specified bits from the lower 64 bits of the 128-bit
|
|
51
|
+
/// integer vector operand at the index and of the length specified by
|
|
52
|
+
/// \a __y.
|
|
53
|
+
///
|
|
54
|
+
/// \headerfile <x86intrin.h>
|
|
55
|
+
///
|
|
56
|
+
/// This intrinsic corresponds to the <c> EXTRQ </c> instruction.
|
|
57
|
+
///
|
|
58
|
+
/// \param __x
|
|
59
|
+
/// The value from which bits are extracted.
|
|
60
|
+
/// \param __y
|
|
61
|
+
/// Specifies the index of the least significant bit at [13:8] and the
|
|
62
|
+
/// length at [5:0]; all other bits are ignored. If bits [5:0] are zero, the
|
|
63
|
+
/// length is interpreted as 64. If the sum of the index and length is
|
|
64
|
+
/// greater than 64, the result is undefined. If the length and index are
|
|
65
|
+
/// both zero, bits [63:0] of parameter \a __x are extracted. If the length
|
|
66
|
+
/// is zero but the index is non-zero, the result is undefined.
|
|
67
|
+
/// \returns A 128-bit vector whose lower 64 bits contain the bits extracted
|
|
68
|
+
/// from the source operand.
|
|
69
|
+
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
|
70
|
+
_mm_extract_si64(__m128i __x, __m128i __y)
|
|
71
|
+
{
|
|
72
|
+
return (__m128i)__builtin_ia32_extrq((__v2di)__x, (__v16qi)__y);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// Inserts bits of a specified length from the source integer vector
|
|
76
|
+
/// \a y into the lower 64 bits of the destination integer vector \a x at
|
|
77
|
+
/// the index \a idx and of the length \a len.
|
|
78
|
+
///
|
|
79
|
+
/// \headerfile <x86intrin.h>
|
|
80
|
+
///
|
|
81
|
+
/// \code
|
|
82
|
+
/// __m128i _mm_inserti_si64(__m128i x, __m128i y, const int len,
|
|
83
|
+
/// const int idx);
|
|
84
|
+
/// \endcode
|
|
85
|
+
///
|
|
86
|
+
/// This intrinsic corresponds to the <c> INSERTQ </c> instruction.
|
|
87
|
+
///
|
|
88
|
+
/// \param x
|
|
89
|
+
/// The destination operand where bits will be inserted. The inserted bits
|
|
90
|
+
/// are defined by the length \a len and by the index \a idx specifying the
|
|
91
|
+
/// least significant bit.
|
|
92
|
+
/// \param y
|
|
93
|
+
/// The source operand containing the bits to be extracted. The extracted
|
|
94
|
+
/// bits are the least significant bits of operand \a y of length \a len.
|
|
95
|
+
/// \param len
|
|
96
|
+
/// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0]
|
|
97
|
+
/// are zero, the length is interpreted as 64.
|
|
98
|
+
/// \param idx
|
|
99
|
+
/// Bits [5:0] specify the index of the least significant bit; the other
|
|
100
|
+
/// bits are ignored. If the sum of the index and length is greater than 64,
|
|
101
|
+
/// the result is undefined. If the length and index are both zero, bits
|
|
102
|
+
/// [63:0] of parameter \a y are inserted into parameter \a x. If the length
|
|
103
|
+
/// is zero but the index is non-zero, the result is undefined.
|
|
104
|
+
/// \returns A 128-bit integer vector containing the original lower 64-bits of
|
|
105
|
+
/// destination operand \a x with the specified bitfields replaced by the
|
|
106
|
+
/// lower bits of source operand \a y. The upper 64 bits of the return value
|
|
107
|
+
/// are undefined.
|
|
108
|
+
#define _mm_inserti_si64(x, y, len, idx) \
|
|
109
|
+
((__m128i)__builtin_ia32_insertqi((__v2di)(__m128i)(x), \
|
|
110
|
+
(__v2di)(__m128i)(y), \
|
|
111
|
+
(char)(len), (char)(idx)))
|
|
112
|
+
|
|
113
|
+
/// Inserts bits of a specified length from the source integer vector
|
|
114
|
+
/// \a __y into the lower 64 bits of the destination integer vector \a __x
|
|
115
|
+
/// at the index and of the length specified by \a __y.
|
|
116
|
+
///
|
|
117
|
+
/// \headerfile <x86intrin.h>
|
|
118
|
+
///
|
|
119
|
+
/// This intrinsic corresponds to the <c> INSERTQ </c> instruction.
|
|
120
|
+
///
|
|
121
|
+
/// \param __x
|
|
122
|
+
/// The destination operand where bits will be inserted. The inserted bits
|
|
123
|
+
/// are defined by the length and by the index of the least significant bit
|
|
124
|
+
/// specified by operand \a __y.
|
|
125
|
+
/// \param __y
|
|
126
|
+
/// The source operand containing the bits to be extracted. The extracted
|
|
127
|
+
/// bits are the least significant bits of operand \a __y with length
|
|
128
|
+
/// specified by bits [69:64]. These are inserted into the destination at the
|
|
129
|
+
/// index specified by bits [77:72]; all other bits are ignored. If bits
|
|
130
|
+
/// [69:64] are zero, the length is interpreted as 64. If the sum of the
|
|
131
|
+
/// index and length is greater than 64, the result is undefined. If the
|
|
132
|
+
/// length and index are both zero, bits [63:0] of parameter \a __y are
|
|
133
|
+
/// inserted into parameter \a __x. If the length is zero but the index is
|
|
134
|
+
/// non-zero, the result is undefined.
|
|
135
|
+
/// \returns A 128-bit integer vector containing the original lower 64-bits of
|
|
136
|
+
/// destination operand \a __x with the specified bitfields replaced by the
|
|
137
|
+
/// lower bits of source operand \a __y. The upper 64 bits of the return
|
|
138
|
+
/// value are undefined.
|
|
139
|
+
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
|
140
|
+
_mm_insert_si64(__m128i __x, __m128i __y)
|
|
141
|
+
{
|
|
142
|
+
return (__m128i)__builtin_ia32_insertq((__v2di)__x, (__v2di)__y);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/// Stores a 64-bit double-precision value in a 64-bit memory location.
|
|
146
|
+
/// To minimize caching, the data is flagged as non-temporal (unlikely to be
|
|
147
|
+
/// used again soon).
|
|
148
|
+
///
|
|
149
|
+
/// \headerfile <x86intrin.h>
|
|
150
|
+
///
|
|
151
|
+
/// This intrinsic corresponds to the <c> MOVNTSD </c> instruction.
|
|
152
|
+
///
|
|
153
|
+
/// \param __p
|
|
154
|
+
/// The 64-bit memory location used to store the register value.
|
|
155
|
+
/// \param __a
|
|
156
|
+
/// The 64-bit double-precision floating-point register value to be stored.
|
|
157
|
+
static __inline__ void __DEFAULT_FN_ATTRS
|
|
158
|
+
_mm_stream_sd(void *__p, __m128d __a)
|
|
159
|
+
{
|
|
160
|
+
__builtin_ia32_movntsd((double *)__p, (__v2df)__a);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/// Stores a 32-bit single-precision floating-point value in a 32-bit
|
|
164
|
+
/// memory location. To minimize caching, the data is flagged as
|
|
165
|
+
/// non-temporal (unlikely to be used again soon).
|
|
166
|
+
///
|
|
167
|
+
/// \headerfile <x86intrin.h>
|
|
168
|
+
///
|
|
169
|
+
/// This intrinsic corresponds to the <c> MOVNTSS </c> instruction.
|
|
170
|
+
///
|
|
171
|
+
/// \param __p
|
|
172
|
+
/// The 32-bit memory location used to store the register value.
|
|
173
|
+
/// \param __a
|
|
174
|
+
/// The 32-bit single-precision floating-point register value to be stored.
|
|
175
|
+
static __inline__ void __DEFAULT_FN_ATTRS
|
|
176
|
+
_mm_stream_ss(void *__p, __m128 __a)
|
|
177
|
+
{
|
|
178
|
+
__builtin_ia32_movntss((float *)__p, (__v4sf)__a);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
#undef __DEFAULT_FN_ATTRS
|
|
182
|
+
|
|
183
|
+
#endif /* __AMMINTRIN_H */
|
package/include/amo.h
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/*===---- amo.h - PowerPC Atomic Memory 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
|
+
/* This header provides compatibility for GCC's AMO functions.
|
|
10
|
+
* The functions here call Clang's underlying AMO builtins.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#ifndef _AMO_H
|
|
14
|
+
#define _AMO_H
|
|
15
|
+
|
|
16
|
+
#include <stdint.h>
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
extern "C" {
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
/* AMO Load Operation Codes (FC values) */
|
|
23
|
+
enum {
|
|
24
|
+
_AMO_LD_ADD = 0x00, /* Fetch and Add */
|
|
25
|
+
_AMO_LD_XOR = 0x01, /* Fetch and XOR */
|
|
26
|
+
_AMO_LD_IOR = 0x02, /* Fetch and OR */
|
|
27
|
+
_AMO_LD_AND = 0x03, /* Fetch and AND */
|
|
28
|
+
_AMO_LD_UMAX = 0x04, /* Fetch and Maximum Unsigned */
|
|
29
|
+
_AMO_LD_SMAX = 0x05, /* Fetch and Maximum Signed */
|
|
30
|
+
_AMO_LD_UMIN = 0x06, /* Fetch and Minimum Unsigned */
|
|
31
|
+
_AMO_LD_SMIN = 0x07, /* Fetch and Minimum Signed */
|
|
32
|
+
_AMO_LD_SWAP = 0x08 /* Swap */
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/* 32-bit unsigned AMO load operations */
|
|
36
|
+
static inline uint32_t amo_lwat_add(uint32_t *ptr, uint32_t val) {
|
|
37
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_ADD);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static inline uint32_t amo_lwat_xor(uint32_t *ptr, uint32_t val) {
|
|
41
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_XOR);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static inline uint32_t amo_lwat_ior(uint32_t *ptr, uint32_t val) {
|
|
45
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_IOR);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static inline uint32_t amo_lwat_and(uint32_t *ptr, uint32_t val) {
|
|
49
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_AND);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static inline uint32_t amo_lwat_umax(uint32_t *ptr, uint32_t val) {
|
|
53
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_UMAX);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static inline uint32_t amo_lwat_umin(uint32_t *ptr, uint32_t val) {
|
|
57
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_UMIN);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static inline uint32_t amo_lwat_swap(uint32_t *ptr, uint32_t val) {
|
|
61
|
+
return __builtin_amo_lwat(ptr, val, _AMO_LD_SWAP);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* 32-bit signed AMO load operations */
|
|
65
|
+
static inline int32_t amo_lwat_sadd(int32_t *ptr, int32_t val) {
|
|
66
|
+
return __builtin_amo_lwat_s(ptr, val, _AMO_LD_ADD);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static inline int32_t amo_lwat_smax(int32_t *ptr, int32_t val) {
|
|
70
|
+
return __builtin_amo_lwat_s(ptr, val, _AMO_LD_SMAX);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static inline int32_t amo_lwat_smin(int32_t *ptr, int32_t val) {
|
|
74
|
+
return __builtin_amo_lwat_s(ptr, val, _AMO_LD_SMIN);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static inline int32_t amo_lwat_sswap(int32_t *ptr, int32_t val) {
|
|
78
|
+
return __builtin_amo_lwat_s(ptr, val, _AMO_LD_SWAP);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 64-bit unsigned AMO load operations */
|
|
82
|
+
static inline uint64_t amo_ldat_add(uint64_t *ptr, uint64_t val) {
|
|
83
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_ADD);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static inline uint64_t amo_ldat_xor(uint64_t *ptr, uint64_t val) {
|
|
87
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_XOR);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static inline uint64_t amo_ldat_ior(uint64_t *ptr, uint64_t val) {
|
|
91
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_IOR);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static inline uint64_t amo_ldat_and(uint64_t *ptr, uint64_t val) {
|
|
95
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_AND);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static inline uint64_t amo_ldat_umax(uint64_t *ptr, uint64_t val) {
|
|
99
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_UMAX);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static inline uint64_t amo_ldat_umin(uint64_t *ptr, uint64_t val) {
|
|
103
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_UMIN);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static inline uint64_t amo_ldat_swap(uint64_t *ptr, uint64_t val) {
|
|
107
|
+
return __builtin_amo_ldat(ptr, val, _AMO_LD_SWAP);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* 64-bit signed AMO load operations */
|
|
111
|
+
static inline int64_t amo_ldat_sadd(int64_t *ptr, int64_t val) {
|
|
112
|
+
return __builtin_amo_ldat_s(ptr, val, _AMO_LD_ADD);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static inline int64_t amo_ldat_smax(int64_t *ptr, int64_t val) {
|
|
116
|
+
return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SMAX);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
static inline int64_t amo_ldat_smin(int64_t *ptr, int64_t val) {
|
|
120
|
+
return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SMIN);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static inline int64_t amo_ldat_sswap(int64_t *ptr, int64_t val) {
|
|
124
|
+
return __builtin_amo_ldat_s(ptr, val, _AMO_LD_SWAP);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* AMO Store Operation Codes (FC values) */
|
|
128
|
+
enum _AMO_ST {
|
|
129
|
+
_AMO_ST_ADD = 0x00, /* Store Add */
|
|
130
|
+
_AMO_ST_XOR = 0x01, /* Store Xor */
|
|
131
|
+
_AMO_ST_IOR = 0x02, /* Store Ior */
|
|
132
|
+
_AMO_ST_AND = 0x03, /* Store And */
|
|
133
|
+
_AMO_ST_UMAX = 0x04, /* Store Unsigned Maximum */
|
|
134
|
+
_AMO_ST_SMAX = 0x05, /* Store Signed Maximum */
|
|
135
|
+
_AMO_ST_UMIN = 0x06, /* Store Unsigned Minimum */
|
|
136
|
+
_AMO_ST_SMIN = 0x07, /* Store Signed Minimum */
|
|
137
|
+
_AMO_ST_TWIN = 0x18 /* Store Twin */
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/* 32-bit unsigned AMO store operations */
|
|
141
|
+
static inline void amo_stwat_add(uint32_t *ptr, uint32_t val) {
|
|
142
|
+
__builtin_amo_stwat(ptr, val, _AMO_ST_ADD);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static inline void amo_stwat_xor(uint32_t *ptr, uint32_t val) {
|
|
146
|
+
__builtin_amo_stwat(ptr, val, _AMO_ST_XOR);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static inline void amo_stwat_ior(uint32_t *ptr, uint32_t val) {
|
|
150
|
+
__builtin_amo_stwat(ptr, val, _AMO_ST_IOR);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static inline void amo_stwat_and(uint32_t *ptr, uint32_t val) {
|
|
154
|
+
__builtin_amo_stwat(ptr, val, _AMO_ST_AND);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static inline void amo_stwat_umax(uint32_t *ptr, uint32_t val) {
|
|
158
|
+
__builtin_amo_stwat(ptr, val, _AMO_ST_UMAX);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static inline void amo_stwat_umin(uint32_t *ptr, uint32_t val) {
|
|
162
|
+
__builtin_amo_stwat(ptr, val, _AMO_ST_UMIN);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* 32-bit signed AMO store operations */
|
|
166
|
+
static inline void amo_stwat_sadd(int32_t *ptr, int32_t val) {
|
|
167
|
+
__builtin_amo_stwat_s(ptr, val, _AMO_ST_ADD);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
static inline void amo_stwat_smax(int32_t *ptr, int32_t val) {
|
|
171
|
+
__builtin_amo_stwat_s(ptr, val, _AMO_ST_SMAX);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
static inline void amo_stwat_smin(int32_t *ptr, int32_t val) {
|
|
175
|
+
__builtin_amo_stwat_s(ptr, val, _AMO_ST_SMIN);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* 64-bit unsigned AMO store operations */
|
|
179
|
+
static inline void amo_stdat_add(uint64_t *ptr, uint64_t val) {
|
|
180
|
+
__builtin_amo_stdat(ptr, val, _AMO_ST_ADD);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
static inline void amo_stdat_xor(uint64_t *ptr, uint64_t val) {
|
|
184
|
+
__builtin_amo_stdat(ptr, val, _AMO_ST_XOR);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
static inline void amo_stdat_ior(uint64_t *ptr, uint64_t val) {
|
|
188
|
+
__builtin_amo_stdat(ptr, val, _AMO_ST_IOR);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
static inline void amo_stdat_and(uint64_t *ptr, uint64_t val) {
|
|
192
|
+
__builtin_amo_stdat(ptr, val, _AMO_ST_AND);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
static inline void amo_stdat_umax(uint64_t *ptr, uint64_t val) {
|
|
196
|
+
__builtin_amo_stdat(ptr, val, _AMO_ST_UMAX);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static inline void amo_stdat_umin(uint64_t *ptr, uint64_t val) {
|
|
200
|
+
__builtin_amo_stdat(ptr, val, _AMO_ST_UMIN);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* 64-bit signed AMO store operations */
|
|
204
|
+
static inline void amo_stdat_sadd(int64_t *ptr, int64_t val) {
|
|
205
|
+
__builtin_amo_stdat_s(ptr, val, _AMO_ST_ADD);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static inline void amo_stdat_smax(int64_t *ptr, int64_t val) {
|
|
209
|
+
__builtin_amo_stdat_s(ptr, val, _AMO_ST_SMAX);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static inline void amo_stdat_smin(int64_t *ptr, int64_t val) {
|
|
213
|
+
__builtin_amo_stdat_s(ptr, val, _AMO_ST_SMIN);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
#ifdef __cplusplus
|
|
217
|
+
}
|
|
218
|
+
#endif
|
|
219
|
+
|
|
220
|
+
#endif /* _AMO_H */
|