@cpp-linter/clang-tidy-darwin-arm64 16.0.3 → 18.1.5
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/README.md +2 -2
- package/bin/clang-tidy +2 -2
- package/lib/clang/{16 → 18}/include/__clang_cuda_device_functions.h +2 -2
- package/lib/clang/{16 → 18}/include/__clang_cuda_intrinsics.h +191 -0
- package/lib/clang/{16 → 18}/include/__clang_cuda_libdevice_declares.h +2 -2
- package/lib/clang/{16 → 18}/include/__clang_cuda_math.h +3 -3
- package/lib/clang/{16 → 18}/include/__clang_cuda_runtime_wrapper.h +2 -2
- package/lib/clang/{16 → 18}/include/__clang_hip_cmath.h +1 -1
- package/lib/clang/{16 → 18}/include/__clang_hip_libdevice_declares.h +32 -30
- package/lib/clang/{16 → 18}/include/__clang_hip_math.h +244 -238
- package/lib/clang/{16 → 18}/include/__clang_hip_runtime_wrapper.h +44 -23
- package/lib/clang/18/include/__stdarg___gnuc_va_list.h +13 -0
- package/lib/clang/18/include/__stdarg___va_copy.h +12 -0
- package/lib/clang/18/include/__stdarg_va_arg.h +22 -0
- package/lib/clang/18/include/__stdarg_va_copy.h +12 -0
- package/lib/clang/18/include/__stdarg_va_list.h +13 -0
- package/lib/clang/{16 → 18}/include/__stddef_max_align_t.h +1 -1
- package/lib/clang/18/include/__stddef_null.h +29 -0
- package/lib/clang/18/include/__stddef_nullptr_t.h +29 -0
- package/lib/clang/18/include/__stddef_offsetof.h +17 -0
- package/lib/clang/18/include/__stddef_ptrdiff_t.h +20 -0
- package/lib/clang/18/include/__stddef_rsize_t.h +20 -0
- package/lib/clang/18/include/__stddef_size_t.h +20 -0
- package/lib/clang/18/include/__stddef_unreachable.h +21 -0
- package/lib/clang/18/include/__stddef_wchar_t.h +28 -0
- package/lib/clang/18/include/__stddef_wint_t.h +15 -0
- package/lib/clang/18/include/adcintrin.h +160 -0
- package/lib/clang/18/include/adxintrin.h +102 -0
- package/lib/clang/{16 → 18}/include/altivec.h +167 -136
- package/lib/clang/{16 → 18}/include/ammintrin.h +4 -4
- package/lib/clang/18/include/amxcomplexintrin.h +169 -0
- package/lib/clang/{16 → 18}/include/arm_acle.h +124 -40
- package/lib/clang/{16 → 18}/include/arm_neon.h +249 -328
- package/lib/clang/18/include/arm_sme.h +2412 -0
- package/lib/clang/{16 → 18}/include/arm_sve.h +7454 -364
- package/lib/clang/18/include/arm_vector_types.h +345 -0
- package/lib/clang/18/include/avx2intrin.h +5284 -0
- package/lib/clang/{16 → 18}/include/avx512bf16intrin.h +3 -2
- package/lib/clang/{16 → 18}/include/avx512bitalgintrin.h +4 -1
- package/lib/clang/{16 → 18}/include/avx512bwintrin.h +28 -38
- package/lib/clang/{16 → 18}/include/avx512cdintrin.h +3 -1
- package/lib/clang/{16 → 18}/include/avx512dqintrin.h +4 -2
- package/lib/clang/{16 → 18}/include/avx512fintrin.h +24 -10
- package/lib/clang/{16 → 18}/include/avx512fp16intrin.h +18 -12
- package/lib/clang/{16 → 18}/include/avx512ifmaintrin.h +3 -1
- package/lib/clang/{16 → 18}/include/avx512ifmavlintrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512pfintrin.h +0 -5
- package/lib/clang/{16 → 18}/include/avx512vbmi2intrin.h +1 -1
- package/lib/clang/{16 → 18}/include/avx512vbmiintrin.h +3 -2
- package/lib/clang/{16 → 18}/include/avx512vbmivlintrin.h +8 -3
- package/lib/clang/{16 → 18}/include/avx512vlbf16intrin.h +8 -6
- package/lib/clang/{16 → 18}/include/avx512vlbitalgintrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512vlbwintrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512vlcdintrin.h +8 -3
- package/lib/clang/{16 → 18}/include/avx512vldqintrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512vlfp16intrin.h +2 -2
- package/lib/clang/{16 → 18}/include/avx512vlintrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512vlvbmi2intrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512vlvnniintrin.h +8 -2
- package/lib/clang/{16 → 18}/include/avx512vlvp2intersectintrin.h +6 -4
- package/lib/clang/{16 → 18}/include/avx512vnniintrin.h +3 -2
- package/lib/clang/{16 → 18}/include/avx512vp2intersectintrin.h +3 -2
- package/lib/clang/{16 → 18}/include/avx512vpopcntdqintrin.h +3 -1
- package/lib/clang/{16 → 18}/include/avx512vpopcntdqvlintrin.h +6 -2
- package/lib/clang/{16 → 18}/include/avxintrin.h +29 -12
- package/lib/clang/18/include/avxvnniint16intrin.h +473 -0
- package/lib/clang/18/include/bmi2intrin.h +255 -0
- package/lib/clang/{16 → 18}/include/bmiintrin.h +231 -46
- package/lib/clang/{16 → 18}/include/clflushoptintrin.h +9 -0
- package/lib/clang/{16 → 18}/include/clzerointrin.h +7 -5
- package/lib/clang/18/include/cuda_wrappers/bits/basic_string.h +9 -0
- package/lib/clang/18/include/cuda_wrappers/bits/basic_string.tcc +9 -0
- package/lib/clang/18/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
- package/lib/clang/{16 → 18}/include/emmintrin.h +10 -10
- package/lib/clang/18/include/fmaintrin.h +780 -0
- package/lib/clang/{16 → 18}/include/gfniintrin.h +23 -6
- package/lib/clang/18/include/hlsl/hlsl_intrinsics.h +624 -0
- package/lib/clang/18/include/ia32intrin.h +863 -0
- package/lib/clang/{16 → 18}/include/immintrin.h +182 -11
- package/lib/clang/{16 → 18}/include/intrin.h +16 -0
- package/lib/clang/{16 → 18}/include/larchintrin.h +13 -1
- package/lib/clang/18/include/lasxintrin.h +3884 -0
- package/lib/clang/{16 → 18}/include/limits.h +7 -5
- package/lib/clang/18/include/llvm_libc_wrappers/assert.h +34 -0
- package/lib/clang/18/include/llvm_libc_wrappers/ctype.h +102 -0
- package/lib/clang/18/include/llvm_libc_wrappers/inttypes.h +34 -0
- package/lib/clang/18/include/llvm_libc_wrappers/stdio.h +80 -0
- package/lib/clang/18/include/llvm_libc_wrappers/stdlib.h +45 -0
- package/lib/clang/18/include/llvm_libc_wrappers/string.h +96 -0
- package/lib/clang/18/include/llvm_libc_wrappers/time.h +34 -0
- package/lib/clang/18/include/lsxintrin.h +3750 -0
- package/lib/clang/{16 → 18}/include/mmintrin.h +7 -5
- package/lib/clang/{16 → 18}/include/module.modulemap +155 -2
- package/lib/clang/18/include/mwaitxintrin.h +62 -0
- package/lib/clang/{16 → 18}/include/opencl-c-base.h +8 -0
- package/lib/clang/{16 → 18}/include/openmp_wrappers/__clang_openmp_device_functions.h +0 -1
- package/lib/clang/{16 → 18}/include/openmp_wrappers/cmath +1 -1
- package/lib/clang/{16 → 18}/include/openmp_wrappers/new +1 -1
- package/lib/clang/{16 → 18}/include/pmmintrin.h +15 -8
- package/lib/clang/{16 → 18}/include/ppc_wrappers/emmintrin.h +2 -1
- package/lib/clang/18/include/ppc_wrappers/nmmintrin.h +26 -0
- package/lib/clang/{16 → 18}/include/ppc_wrappers/smmintrin.h +37 -17
- package/lib/clang/18/include/rdseedintrin.h +105 -0
- package/lib/clang/18/include/riscv_bitmanip.h +195 -0
- package/lib/clang/18/include/riscv_crypto.h +170 -0
- package/lib/clang/18/include/riscv_ntlh.h +26 -0
- package/lib/clang/18/include/riscv_vector.h +431 -0
- package/lib/clang/18/include/sha512intrin.h +200 -0
- package/lib/clang/18/include/shaintrin.h +189 -0
- package/lib/clang/18/include/sifive_vector.h +16 -0
- package/lib/clang/18/include/sm3intrin.h +238 -0
- package/lib/clang/18/include/sm4intrin.h +269 -0
- package/lib/clang/{16 → 18}/include/smmintrin.h +3 -3
- package/lib/clang/{16 → 18}/include/stdalign.h +3 -0
- package/lib/clang/18/include/stdarg.h +79 -0
- package/lib/clang/{16 → 18}/include/stdatomic.h +7 -2
- package/lib/clang/18/include/stdckdint.h +42 -0
- package/lib/clang/18/include/stddef.h +123 -0
- package/lib/clang/{16 → 18}/include/stdint.h +19 -48
- package/lib/clang/{16 → 18}/include/stdnoreturn.h +2 -2
- package/lib/clang/{16 → 18}/include/tmmintrin.h +7 -2
- package/lib/clang/18/include/usermsrintrin.h +51 -0
- package/lib/clang/{16 → 18}/include/vaesintrin.h +4 -2
- package/lib/clang/{16 → 18}/include/vecintrin.h +217 -199
- package/lib/clang/{16 → 18}/include/wasm_simd128.h +132 -12
- package/lib/clang/{16 → 18}/include/x86gprintrin.h +5 -0
- package/lib/clang/{16 → 18}/include/xmmintrin.h +9 -5
- package/lib/clang/18/include/xsavecintrin.h +84 -0
- package/package.json +6 -6
- package/lib/clang/16/include/adxintrin.h +0 -72
- package/lib/clang/16/include/avx2intrin.h +0 -1148
- package/lib/clang/16/include/bmi2intrin.h +0 -81
- package/lib/clang/16/include/fmaintrin.h +0 -216
- package/lib/clang/16/include/hlsl/hlsl_intrinsics.h +0 -223
- package/lib/clang/16/include/ia32intrin.h +0 -441
- package/lib/clang/16/include/mwaitxintrin.h +0 -33
- package/lib/clang/16/include/rdseedintrin.h +0 -42
- package/lib/clang/16/include/riscv_vector.h +0 -211
- package/lib/clang/16/include/shaintrin.h +0 -61
- package/lib/clang/16/include/stdarg.h +0 -51
- package/lib/clang/16/include/stddef.h +0 -128
- package/lib/clang/16/include/xsavecintrin.h +0 -34
- /package/lib/clang/{16 → 18}/include/__clang_cuda_builtin_vars.h +0 -0
- /package/lib/clang/{16 → 18}/include/__clang_cuda_cmath.h +0 -0
- /package/lib/clang/{16 → 18}/include/__clang_cuda_complex_builtins.h +0 -0
- /package/lib/clang/{16 → 18}/include/__clang_cuda_math_forward_declares.h +0 -0
- /package/lib/clang/{16 → 18}/include/__clang_cuda_texture_intrinsics.h +0 -0
- /package/lib/clang/{16 → 18}/include/__clang_hip_stdlib.h +0 -0
- /package/lib/clang/{16 → 18}/include/__wmmintrin_aes.h +0 -0
- /package/lib/clang/{16 → 18}/include/__wmmintrin_pclmul.h +0 -0
- /package/lib/clang/{16 → 18}/include/amxfp16intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/amxintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm64intr.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm_bf16.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm_cde.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm_cmse.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm_fp16.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm_mve.h +0 -0
- /package/lib/clang/{16 → 18}/include/arm_neon_sve_bridge.h +0 -0
- /package/lib/clang/{16 → 18}/include/armintr.h +0 -0
- /package/lib/clang/{16 → 18}/include/avx512erintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/avxifmaintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/avxneconvertintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/avxvnniint8intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/avxvnniintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/builtins.h +0 -0
- /package/lib/clang/{16 → 18}/include/cet.h +0 -0
- /package/lib/clang/{16 → 18}/include/cetintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/cldemoteintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/clwbintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/cmpccxaddintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/cpuid.h +0 -0
- /package/lib/clang/{16 → 18}/include/crc32intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/cuda_wrappers/algorithm +0 -0
- /package/lib/clang/{16 → 18}/include/cuda_wrappers/cmath +0 -0
- /package/lib/clang/{16 → 18}/include/cuda_wrappers/complex +0 -0
- /package/lib/clang/{16 → 18}/include/cuda_wrappers/new +0 -0
- /package/lib/clang/{16 → 18}/include/enqcmdintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/f16cintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/float.h +0 -0
- /package/lib/clang/{16 → 18}/include/fma4intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/fxsrintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/hexagon_circ_brev_intrinsics.h +0 -0
- /package/lib/clang/{16 → 18}/include/hexagon_protos.h +0 -0
- /package/lib/clang/{16 → 18}/include/hexagon_types.h +0 -0
- /package/lib/clang/{16 → 18}/include/hlsl/hlsl_basic_types.h +0 -0
- /package/lib/clang/{16 → 18}/include/hlsl.h +0 -0
- /package/lib/clang/{16 → 18}/include/hresetintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/htmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/htmxlintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/hvx_hexagon_protos.h +0 -0
- /package/lib/clang/{16 → 18}/include/inttypes.h +0 -0
- /package/lib/clang/{16 → 18}/include/invpcidintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/iso646.h +0 -0
- /package/lib/clang/{16 → 18}/include/keylockerintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/lwpintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/lzcntintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/mm3dnow.h +0 -0
- /package/lib/clang/{16 → 18}/include/mm_malloc.h +0 -0
- /package/lib/clang/{16 → 18}/include/movdirintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/msa.h +0 -0
- /package/lib/clang/{16 → 18}/include/nmmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/opencl-c.h +0 -0
- /package/lib/clang/{16 → 18}/include/openmp_wrappers/complex +0 -0
- /package/lib/clang/{16 → 18}/include/openmp_wrappers/complex.h +0 -0
- /package/lib/clang/{16 → 18}/include/openmp_wrappers/complex_cmath.h +0 -0
- /package/lib/clang/{16 → 18}/include/openmp_wrappers/math.h +0 -0
- /package/lib/clang/{16 → 18}/include/pconfigintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/pkuintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/popcntintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/bmi2intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/bmiintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/immintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/mm_malloc.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/mmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/pmmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/tmmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/x86gprintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/x86intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ppc_wrappers/xmmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/prfchiintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/prfchwintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/ptwriteintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/raointintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/rdpruintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/rtmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/s390intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/serializeintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/sgxintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/stdbool.h +0 -0
- /package/lib/clang/{16 → 18}/include/tbmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/tgmath.h +0 -0
- /package/lib/clang/{16 → 18}/include/tsxldtrkintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/uintrintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/unwind.h +0 -0
- /package/lib/clang/{16 → 18}/include/vadefs.h +0 -0
- /package/lib/clang/{16 → 18}/include/varargs.h +0 -0
- /package/lib/clang/{16 → 18}/include/velintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/velintrin_approx.h +0 -0
- /package/lib/clang/{16 → 18}/include/velintrin_gen.h +0 -0
- /package/lib/clang/{16 → 18}/include/vpclmulqdqintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/waitpkgintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/wbnoinvdintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/wmmintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/x86intrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/xopintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/xsaveintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/xsaveoptintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/xsavesintrin.h +0 -0
- /package/lib/clang/{16 → 18}/include/xtestintrin.h +0 -0
|
@@ -47,28 +47,9 @@ extern "C" {
|
|
|
47
47
|
#endif //__cplusplus
|
|
48
48
|
|
|
49
49
|
#if !defined(__HIPCC_RTC__)
|
|
50
|
-
#include <cmath>
|
|
51
|
-
#include <cstdlib>
|
|
52
|
-
#include <stdlib.h>
|
|
53
50
|
#if __has_include("hip/hip_version.h")
|
|
54
51
|
#include "hip/hip_version.h"
|
|
55
52
|
#endif // __has_include("hip/hip_version.h")
|
|
56
|
-
#else
|
|
57
|
-
typedef __SIZE_TYPE__ size_t;
|
|
58
|
-
// Define macros which are needed to declare HIP device API's without standard
|
|
59
|
-
// C/C++ headers. This is for readability so that these API's can be written
|
|
60
|
-
// the same way as non-hipRTC use case. These macros need to be popped so that
|
|
61
|
-
// they do not pollute users' name space.
|
|
62
|
-
#pragma push_macro("NULL")
|
|
63
|
-
#pragma push_macro("uint32_t")
|
|
64
|
-
#pragma push_macro("uint64_t")
|
|
65
|
-
#pragma push_macro("CHAR_BIT")
|
|
66
|
-
#pragma push_macro("INT_MAX")
|
|
67
|
-
#define NULL (void *)0
|
|
68
|
-
#define uint32_t __UINT32_TYPE__
|
|
69
|
-
#define uint64_t __UINT64_TYPE__
|
|
70
|
-
#define CHAR_BIT __CHAR_BIT__
|
|
71
|
-
#define INT_MAX __INTMAX_MAX__
|
|
72
53
|
#endif // __HIPCC_RTC__
|
|
73
54
|
|
|
74
55
|
typedef __SIZE_TYPE__ __hip_size_t;
|
|
@@ -78,14 +59,29 @@ extern "C" {
|
|
|
78
59
|
#endif //__cplusplus
|
|
79
60
|
|
|
80
61
|
#if HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR >= 405
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
__device__ unsigned long long __ockl_dm_alloc(unsigned long long __size);
|
|
63
|
+
__device__ void __ockl_dm_dealloc(unsigned long long __addr);
|
|
64
|
+
#if __has_feature(address_sanitizer)
|
|
65
|
+
__device__ unsigned long long __asan_malloc_impl(unsigned long long __size,
|
|
66
|
+
unsigned long long __pc);
|
|
67
|
+
__device__ void __asan_free_impl(unsigned long long __addr,
|
|
68
|
+
unsigned long long __pc);
|
|
69
|
+
__attribute__((noinline, weak)) __device__ void *malloc(__hip_size_t __size) {
|
|
70
|
+
unsigned long long __pc = (unsigned long long)__builtin_return_address(0);
|
|
71
|
+
return (void *)__asan_malloc_impl(__size, __pc);
|
|
72
|
+
}
|
|
73
|
+
__attribute__((noinline, weak)) __device__ void free(void *__ptr) {
|
|
74
|
+
unsigned long long __pc = (unsigned long long)__builtin_return_address(0);
|
|
75
|
+
__asan_free_impl((unsigned long long)__ptr, __pc);
|
|
76
|
+
}
|
|
77
|
+
#else // __has_feature(address_sanitizer)
|
|
83
78
|
__attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
84
79
|
return (void *) __ockl_dm_alloc(__size);
|
|
85
80
|
}
|
|
86
81
|
__attribute__((weak)) inline __device__ void free(void *__ptr) {
|
|
87
82
|
__ockl_dm_dealloc((unsigned long long)__ptr);
|
|
88
83
|
}
|
|
84
|
+
#endif // __has_feature(address_sanitizer)
|
|
89
85
|
#else // HIP version check
|
|
90
86
|
#if __HIP_ENABLE_DEVICE_MALLOC__
|
|
91
87
|
__device__ void *__hip_malloc(__hip_size_t __size);
|
|
@@ -96,7 +92,7 @@ __attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
|
96
92
|
__attribute__((weak)) inline __device__ void free(void *__ptr) {
|
|
97
93
|
__hip_free(__ptr);
|
|
98
94
|
}
|
|
99
|
-
#else
|
|
95
|
+
#else // __HIP_ENABLE_DEVICE_MALLOC__
|
|
100
96
|
__attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
101
97
|
__builtin_trap();
|
|
102
98
|
return (void *)0;
|
|
@@ -104,13 +100,38 @@ __attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
|
104
100
|
__attribute__((weak)) inline __device__ void free(void *__ptr) {
|
|
105
101
|
__builtin_trap();
|
|
106
102
|
}
|
|
107
|
-
#endif
|
|
103
|
+
#endif // __HIP_ENABLE_DEVICE_MALLOC__
|
|
108
104
|
#endif // HIP version check
|
|
109
105
|
|
|
110
106
|
#ifdef __cplusplus
|
|
111
107
|
} // extern "C"
|
|
112
108
|
#endif //__cplusplus
|
|
113
109
|
|
|
110
|
+
#if !defined(__HIPCC_RTC__)
|
|
111
|
+
#include <cmath>
|
|
112
|
+
#include <cstdlib>
|
|
113
|
+
#include <stdlib.h>
|
|
114
|
+
#if __has_include("hip/hip_version.h")
|
|
115
|
+
#include "hip/hip_version.h"
|
|
116
|
+
#endif // __has_include("hip/hip_version.h")
|
|
117
|
+
#else
|
|
118
|
+
typedef __SIZE_TYPE__ size_t;
|
|
119
|
+
// Define macros which are needed to declare HIP device API's without standard
|
|
120
|
+
// C/C++ headers. This is for readability so that these API's can be written
|
|
121
|
+
// the same way as non-hipRTC use case. These macros need to be popped so that
|
|
122
|
+
// they do not pollute users' name space.
|
|
123
|
+
#pragma push_macro("NULL")
|
|
124
|
+
#pragma push_macro("uint32_t")
|
|
125
|
+
#pragma push_macro("uint64_t")
|
|
126
|
+
#pragma push_macro("CHAR_BIT")
|
|
127
|
+
#pragma push_macro("INT_MAX")
|
|
128
|
+
#define NULL (void *)0
|
|
129
|
+
#define uint32_t __UINT32_TYPE__
|
|
130
|
+
#define uint64_t __UINT64_TYPE__
|
|
131
|
+
#define CHAR_BIT __CHAR_BIT__
|
|
132
|
+
#define INT_MAX __INTMAX_MAX__
|
|
133
|
+
#endif // __HIPCC_RTC__
|
|
134
|
+
|
|
114
135
|
#include <__clang_hip_libdevice_declares.h>
|
|
115
136
|
#include <__clang_hip_math.h>
|
|
116
137
|
#include <__clang_hip_stdlib.h>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*===---- __stdarg___gnuc_va_list.h - Definition of __gnuc_va_list ---------===
|
|
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 __GNUC_VA_LIST
|
|
11
|
+
#define __GNUC_VA_LIST
|
|
12
|
+
typedef __builtin_va_list __gnuc_va_list;
|
|
13
|
+
#endif
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*===---- __stdarg___va_copy.h - Definition of __va_copy -------------------===
|
|
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 __va_copy
|
|
11
|
+
#define __va_copy(d, s) __builtin_va_copy(d, s)
|
|
12
|
+
#endif
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*===---- __stdarg_va_arg.h - Definitions of va_start, va_arg, va_end-------===
|
|
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 va_arg
|
|
11
|
+
|
|
12
|
+
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
|
13
|
+
/* C23 does not require the second parameter for va_start. */
|
|
14
|
+
#define va_start(ap, ...) __builtin_va_start(ap, 0)
|
|
15
|
+
#else
|
|
16
|
+
/* Versions before C23 do require the second parameter. */
|
|
17
|
+
#define va_start(ap, param) __builtin_va_start(ap, param)
|
|
18
|
+
#endif
|
|
19
|
+
#define va_end(ap) __builtin_va_end(ap)
|
|
20
|
+
#define va_arg(ap, type) __builtin_va_arg(ap, type)
|
|
21
|
+
|
|
22
|
+
#endif
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*===---- __stdarg_va_copy.h - Definition of va_copy------------------------===
|
|
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 va_copy
|
|
11
|
+
#define va_copy(dest, src) __builtin_va_copy(dest, src)
|
|
12
|
+
#endif
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*===---- __stdarg_va_list.h - Definition of va_list -----------------------===
|
|
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 _VA_LIST
|
|
11
|
+
#define _VA_LIST
|
|
12
|
+
typedef __builtin_va_list va_list;
|
|
13
|
+
#endif
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*===---- __stddef_max_align_t.h - Definition of max_align_t
|
|
1
|
+
/*===---- __stddef_max_align_t.h - Definition of max_align_t ---------------===
|
|
2
2
|
*
|
|
3
3
|
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
4
4
|
* See https://llvm.org/LICENSE.txt for license information.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*===---- __stddef_null.h - Definition of NULL -----------------------------===
|
|
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
|
+
#if !defined(NULL) || !__building_module(_Builtin_stddef)
|
|
11
|
+
|
|
12
|
+
/* linux/stddef.h will define NULL to 0. glibc (and other) headers then define
|
|
13
|
+
* __need_NULL and rely on stddef.h to redefine NULL to the correct value again.
|
|
14
|
+
* Modules don't support redefining macros like that, but support that pattern
|
|
15
|
+
* in the non-modules case.
|
|
16
|
+
*/
|
|
17
|
+
#undef NULL
|
|
18
|
+
|
|
19
|
+
#ifdef __cplusplus
|
|
20
|
+
#if !defined(__MINGW32__) && !defined(_MSC_VER)
|
|
21
|
+
#define NULL __null
|
|
22
|
+
#else
|
|
23
|
+
#define NULL 0
|
|
24
|
+
#endif
|
|
25
|
+
#else
|
|
26
|
+
#define NULL ((void*)0)
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#endif
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*===---- __stddef_nullptr_t.h - Definition of nullptr_t -------------------===
|
|
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
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
12
|
+
* and needs to behave as if it was textual.
|
|
13
|
+
*/
|
|
14
|
+
#if !defined(_NULLPTR_T) || \
|
|
15
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
16
|
+
#define _NULLPTR_T
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
|
|
20
|
+
namespace std {
|
|
21
|
+
typedef decltype(nullptr) nullptr_t;
|
|
22
|
+
}
|
|
23
|
+
using ::std::nullptr_t;
|
|
24
|
+
#endif
|
|
25
|
+
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
|
26
|
+
typedef typeof(nullptr) nullptr_t;
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#endif
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*===---- __stddef_offsetof.h - Definition of offsetof ---------------------===
|
|
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
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
12
|
+
* and needs to behave as if it was textual.
|
|
13
|
+
*/
|
|
14
|
+
#if !defined(offsetof) || \
|
|
15
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
16
|
+
#define offsetof(t, d) __builtin_offsetof(t, d)
|
|
17
|
+
#endif
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*===---- __stddef_ptrdiff_t.h - Definition of ptrdiff_t -------------------===
|
|
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
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
12
|
+
* and needs to behave as if it was textual.
|
|
13
|
+
*/
|
|
14
|
+
#if !defined(_PTRDIFF_T) || \
|
|
15
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
16
|
+
#define _PTRDIFF_T
|
|
17
|
+
|
|
18
|
+
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
19
|
+
|
|
20
|
+
#endif
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*===---- __stddef_rsize_t.h - Definition of rsize_t -----------------------===
|
|
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
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
12
|
+
* and needs to behave as if it was textual.
|
|
13
|
+
*/
|
|
14
|
+
#if !defined(_RSIZE_T) || \
|
|
15
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
16
|
+
#define _RSIZE_T
|
|
17
|
+
|
|
18
|
+
typedef __SIZE_TYPE__ rsize_t;
|
|
19
|
+
|
|
20
|
+
#endif
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*===---- __stddef_size_t.h - Definition of size_t -------------------------===
|
|
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
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
12
|
+
* and needs to behave as if it was textual.
|
|
13
|
+
*/
|
|
14
|
+
#if !defined(_SIZE_T) || \
|
|
15
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
16
|
+
#define _SIZE_T
|
|
17
|
+
|
|
18
|
+
typedef __SIZE_TYPE__ size_t;
|
|
19
|
+
|
|
20
|
+
#endif
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*===---- __stddef_unreachable.h - Definition of unreachable ---------------===
|
|
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 __cplusplus
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
14
|
+
* and needs to behave as if it was textual.
|
|
15
|
+
*/
|
|
16
|
+
#if !defined(unreachable) || \
|
|
17
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
18
|
+
#define unreachable() __builtin_unreachable()
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#endif
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*===---- __stddef_wchar.h - Definition of wchar_t -------------------------===
|
|
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
|
+
#if !defined(__cplusplus) || (defined(_MSC_VER) && !_NATIVE_WCHAR_T_DEFINED)
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header
|
|
14
|
+
* and needs to behave as if it was textual.
|
|
15
|
+
*/
|
|
16
|
+
#if !defined(_WCHAR_T) || \
|
|
17
|
+
(__has_feature(modules) && !__building_module(_Builtin_stddef))
|
|
18
|
+
#define _WCHAR_T
|
|
19
|
+
|
|
20
|
+
#ifdef _MSC_EXTENSIONS
|
|
21
|
+
#define _WCHAR_T_DEFINED
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
typedef __WCHAR_TYPE__ wchar_t;
|
|
25
|
+
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#endif
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*===---- __stddef_wint.h - Definition of wint_t ---------------------------===
|
|
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 _WINT_T
|
|
11
|
+
#define _WINT_T
|
|
12
|
+
|
|
13
|
+
typedef __WINT_TYPE__ wint_t;
|
|
14
|
+
|
|
15
|
+
#endif
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*===---- adcintrin.h - ADC 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 __ADCINTRIN_H
|
|
11
|
+
#define __ADCINTRIN_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
|
+
/* Define the default attributes for the functions in this file. */
|
|
18
|
+
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
|
19
|
+
|
|
20
|
+
/* Use C++ inline semantics in C++, GNU inline for C mode. */
|
|
21
|
+
#if defined(__cplusplus)
|
|
22
|
+
#define __INLINE __inline
|
|
23
|
+
#else
|
|
24
|
+
#define __INLINE static __inline
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
#if defined(__cplusplus)
|
|
28
|
+
extern "C" {
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
/// Adds unsigned 32-bit integers \a __x and \a __y, plus 0 or 1 as indicated
|
|
32
|
+
/// by the carry flag \a __cf. Stores the unsigned 32-bit sum in the memory
|
|
33
|
+
/// at \a __p, and returns the 8-bit carry-out (carry flag).
|
|
34
|
+
///
|
|
35
|
+
/// \code{.operation}
|
|
36
|
+
/// temp := (__cf == 0) ? 0 : 1
|
|
37
|
+
/// Store32(__p, __x + __y + temp)
|
|
38
|
+
/// result := CF
|
|
39
|
+
/// \endcode
|
|
40
|
+
///
|
|
41
|
+
/// \headerfile <immintrin.h>
|
|
42
|
+
///
|
|
43
|
+
/// This intrinsic corresponds to the \c ADC instruction.
|
|
44
|
+
///
|
|
45
|
+
/// \param __cf
|
|
46
|
+
/// The 8-bit unsigned carry flag; any non-zero value indicates carry.
|
|
47
|
+
/// \param __x
|
|
48
|
+
/// A 32-bit unsigned addend.
|
|
49
|
+
/// \param __y
|
|
50
|
+
/// A 32-bit unsigned addend.
|
|
51
|
+
/// \param __p
|
|
52
|
+
/// Pointer to memory for storing the sum.
|
|
53
|
+
/// \returns The 8-bit unsigned carry-out value.
|
|
54
|
+
__INLINE unsigned char __DEFAULT_FN_ATTRS _addcarry_u32(unsigned char __cf,
|
|
55
|
+
unsigned int __x,
|
|
56
|
+
unsigned int __y,
|
|
57
|
+
unsigned int *__p) {
|
|
58
|
+
return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/// Adds unsigned 32-bit integer \a __y to 0 or 1 as indicated by the carry
|
|
62
|
+
/// flag \a __cf, and subtracts the result from unsigned 32-bit integer
|
|
63
|
+
/// \a __x. Stores the unsigned 32-bit difference in the memory at \a __p,
|
|
64
|
+
/// and returns the 8-bit carry-out (carry or overflow flag).
|
|
65
|
+
///
|
|
66
|
+
/// \code{.operation}
|
|
67
|
+
/// temp := (__cf == 0) ? 0 : 1
|
|
68
|
+
/// Store32(__p, __x - (__y + temp))
|
|
69
|
+
/// result := CF
|
|
70
|
+
/// \endcode
|
|
71
|
+
///
|
|
72
|
+
/// \headerfile <immintrin.h>
|
|
73
|
+
///
|
|
74
|
+
/// This intrinsic corresponds to the \c SBB instruction.
|
|
75
|
+
///
|
|
76
|
+
/// \param __cf
|
|
77
|
+
/// The 8-bit unsigned carry flag; any non-zero value indicates carry.
|
|
78
|
+
/// \param __x
|
|
79
|
+
/// The 32-bit unsigned minuend.
|
|
80
|
+
/// \param __y
|
|
81
|
+
/// The 32-bit unsigned subtrahend.
|
|
82
|
+
/// \param __p
|
|
83
|
+
/// Pointer to memory for storing the difference.
|
|
84
|
+
/// \returns The 8-bit unsigned carry-out value.
|
|
85
|
+
__INLINE unsigned char __DEFAULT_FN_ATTRS _subborrow_u32(unsigned char __cf,
|
|
86
|
+
unsigned int __x,
|
|
87
|
+
unsigned int __y,
|
|
88
|
+
unsigned int *__p) {
|
|
89
|
+
return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#ifdef __x86_64__
|
|
93
|
+
/// Adds unsigned 64-bit integers \a __x and \a __y, plus 0 or 1 as indicated
|
|
94
|
+
/// by the carry flag \a __cf. Stores the unsigned 64-bit sum in the memory
|
|
95
|
+
/// at \a __p, and returns the 8-bit carry-out (carry flag).
|
|
96
|
+
///
|
|
97
|
+
/// \code{.operation}
|
|
98
|
+
/// temp := (__cf == 0) ? 0 : 1
|
|
99
|
+
/// Store64(__p, __x + __y + temp)
|
|
100
|
+
/// result := CF
|
|
101
|
+
/// \endcode
|
|
102
|
+
///
|
|
103
|
+
/// \headerfile <immintrin.h>
|
|
104
|
+
///
|
|
105
|
+
/// This intrinsic corresponds to the \c ADC instruction.
|
|
106
|
+
///
|
|
107
|
+
/// \param __cf
|
|
108
|
+
/// The 8-bit unsigned carry flag; any non-zero value indicates carry.
|
|
109
|
+
/// \param __x
|
|
110
|
+
/// A 64-bit unsigned addend.
|
|
111
|
+
/// \param __y
|
|
112
|
+
/// A 64-bit unsigned addend.
|
|
113
|
+
/// \param __p
|
|
114
|
+
/// Pointer to memory for storing the sum.
|
|
115
|
+
/// \returns The 8-bit unsigned carry-out value.
|
|
116
|
+
__INLINE unsigned char __DEFAULT_FN_ATTRS
|
|
117
|
+
_addcarry_u64(unsigned char __cf, unsigned long long __x,
|
|
118
|
+
unsigned long long __y, unsigned long long *__p) {
|
|
119
|
+
return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/// Adds unsigned 64-bit integer \a __y to 0 or 1 as indicated by the carry
|
|
123
|
+
/// flag \a __cf, and subtracts the result from unsigned 64-bit integer
|
|
124
|
+
/// \a __x. Stores the unsigned 64-bit difference in the memory at \a __p,
|
|
125
|
+
/// and returns the 8-bit carry-out (carry or overflow flag).
|
|
126
|
+
///
|
|
127
|
+
/// \code{.operation}
|
|
128
|
+
/// temp := (__cf == 0) ? 0 : 1
|
|
129
|
+
/// Store64(__p, __x - (__y + temp))
|
|
130
|
+
/// result := CF
|
|
131
|
+
/// \endcode
|
|
132
|
+
///
|
|
133
|
+
/// \headerfile <immintrin.h>
|
|
134
|
+
///
|
|
135
|
+
/// This intrinsic corresponds to the \c ADC instruction.
|
|
136
|
+
///
|
|
137
|
+
/// \param __cf
|
|
138
|
+
/// The 8-bit unsigned carry flag; any non-zero value indicates carry.
|
|
139
|
+
/// \param __x
|
|
140
|
+
/// The 64-bit unsigned minuend.
|
|
141
|
+
/// \param __y
|
|
142
|
+
/// The 64-bit unsigned subtrahend.
|
|
143
|
+
/// \param __p
|
|
144
|
+
/// Pointer to memory for storing the difference.
|
|
145
|
+
/// \returns The 8-bit unsigned carry-out value.
|
|
146
|
+
__INLINE unsigned char __DEFAULT_FN_ATTRS
|
|
147
|
+
_subborrow_u64(unsigned char __cf, unsigned long long __x,
|
|
148
|
+
unsigned long long __y, unsigned long long *__p) {
|
|
149
|
+
return __builtin_ia32_subborrow_u64(__cf, __x, __y, __p);
|
|
150
|
+
}
|
|
151
|
+
#endif
|
|
152
|
+
|
|
153
|
+
#if defined(__cplusplus)
|
|
154
|
+
}
|
|
155
|
+
#endif
|
|
156
|
+
|
|
157
|
+
#undef __INLINE
|
|
158
|
+
#undef __DEFAULT_FN_ATTRS
|
|
159
|
+
|
|
160
|
+
#endif /* __ADCINTRIN_H */
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*===---- adxintrin.h - ADX 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 __IMMINTRIN_H
|
|
11
|
+
#error "Never use <adxintrin.h> directly; include <immintrin.h> instead."
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#ifndef __ADXINTRIN_H
|
|
15
|
+
#define __ADXINTRIN_H
|
|
16
|
+
|
|
17
|
+
/* Define the default attributes for the functions in this file. */
|
|
18
|
+
#define __DEFAULT_FN_ATTRS \
|
|
19
|
+
__attribute__((__always_inline__, __nodebug__, __target__("adx")))
|
|
20
|
+
|
|
21
|
+
/* Use C++ inline semantics in C++, GNU inline for C mode. */
|
|
22
|
+
#if defined(__cplusplus)
|
|
23
|
+
#define __INLINE __inline
|
|
24
|
+
#else
|
|
25
|
+
#define __INLINE static __inline
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#if defined(__cplusplus)
|
|
29
|
+
extern "C" {
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
/* Intrinsics that are available only if __ADX__ is defined. */
|
|
33
|
+
|
|
34
|
+
/// Adds unsigned 32-bit integers \a __x and \a __y, plus 0 or 1 as indicated
|
|
35
|
+
/// by the carry flag \a __cf. Stores the unsigned 32-bit sum in the memory
|
|
36
|
+
/// at \a __p, and returns the 8-bit carry-out (carry flag).
|
|
37
|
+
///
|
|
38
|
+
/// \code{.operation}
|
|
39
|
+
/// temp := (__cf == 0) ? 0 : 1
|
|
40
|
+
/// Store32(__p, __x + __y + temp)
|
|
41
|
+
/// result := CF
|
|
42
|
+
/// \endcode
|
|
43
|
+
///
|
|
44
|
+
/// \headerfile <immintrin.h>
|
|
45
|
+
///
|
|
46
|
+
/// This intrinsic corresponds to the \c ADCX instruction.
|
|
47
|
+
///
|
|
48
|
+
/// \param __cf
|
|
49
|
+
/// The 8-bit unsigned carry flag; any non-zero value indicates carry.
|
|
50
|
+
/// \param __x
|
|
51
|
+
/// A 32-bit unsigned addend.
|
|
52
|
+
/// \param __y
|
|
53
|
+
/// A 32-bit unsigned addend.
|
|
54
|
+
/// \param __p
|
|
55
|
+
/// Pointer to memory for storing the sum.
|
|
56
|
+
/// \returns The 8-bit unsigned carry-out value.
|
|
57
|
+
__INLINE unsigned char __DEFAULT_FN_ATTRS _addcarryx_u32(unsigned char __cf,
|
|
58
|
+
unsigned int __x,
|
|
59
|
+
unsigned int __y,
|
|
60
|
+
unsigned int *__p) {
|
|
61
|
+
return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
#ifdef __x86_64__
|
|
65
|
+
/// Adds unsigned 64-bit integers \a __x and \a __y, plus 0 or 1 as indicated
|
|
66
|
+
/// by the carry flag \a __cf. Stores the unsigned 64-bit sum in the memory
|
|
67
|
+
/// at \a __p, and returns the 8-bit carry-out (carry flag).
|
|
68
|
+
///
|
|
69
|
+
/// \code{.operation}
|
|
70
|
+
/// temp := (__cf == 0) ? 0 : 1
|
|
71
|
+
/// Store64(__p, __x + __y + temp)
|
|
72
|
+
/// result := CF
|
|
73
|
+
/// \endcode
|
|
74
|
+
///
|
|
75
|
+
/// \headerfile <immintrin.h>
|
|
76
|
+
///
|
|
77
|
+
/// This intrinsic corresponds to the \c ADCX instruction.
|
|
78
|
+
///
|
|
79
|
+
/// \param __cf
|
|
80
|
+
/// The 8-bit unsigned carry flag; any non-zero value indicates carry.
|
|
81
|
+
/// \param __x
|
|
82
|
+
/// A 64-bit unsigned addend.
|
|
83
|
+
/// \param __y
|
|
84
|
+
/// A 64-bit unsigned addend.
|
|
85
|
+
/// \param __p
|
|
86
|
+
/// Pointer to memory for storing the sum.
|
|
87
|
+
/// \returns The 8-bit unsigned carry-out value.
|
|
88
|
+
__INLINE unsigned char __DEFAULT_FN_ATTRS
|
|
89
|
+
_addcarryx_u64(unsigned char __cf, unsigned long long __x,
|
|
90
|
+
unsigned long long __y, unsigned long long *__p) {
|
|
91
|
+
return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p);
|
|
92
|
+
}
|
|
93
|
+
#endif
|
|
94
|
+
|
|
95
|
+
#if defined(__cplusplus)
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
#undef __INLINE
|
|
100
|
+
#undef __DEFAULT_FN_ATTRS
|
|
101
|
+
|
|
102
|
+
#endif /* __ADXINTRIN_H */
|