llvm-runtime-resources-darwin 22.1.8 → 23.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/include/__clang_cuda_complex_builtins.h +10 -3
  2. package/include/__clang_cuda_intrinsics.h +207 -226
  3. package/include/__clang_cuda_math_forward_declares.h +5 -0
  4. package/include/__clang_cuda_runtime_wrapper.h +9 -5
  5. package/include/__clang_gpu_builtin_vars.h +71 -0
  6. package/include/__clang_gpu_device_functions.h +411 -0
  7. package/include/__clang_gpu_intrinsics.h +242 -0
  8. package/include/__clang_hip_libdevice_declares.h +0 -102
  9. package/include/__clang_hip_math.h +3 -3
  10. package/include/__clang_hip_runtime_wrapper.h +6 -1
  11. package/include/__clang_spirv_libdevice_declares.h +170 -0
  12. package/include/__clang_spirv_math.h +719 -0
  13. package/include/altivec.h +79 -9
  14. package/include/amdgpuintrin.h +2 -29
  15. package/include/amdhsa_abi.h +83 -0
  16. package/include/amo.h +89 -0
  17. package/include/andes_vector.h +5 -0
  18. package/include/arm64_neon.h +21 -0
  19. package/include/arm64intr.h +10 -0
  20. package/include/arm_acle.h +1 -0
  21. package/include/arm_neon.h +3922 -3754
  22. package/include/arm_sme.h +12 -0
  23. package/include/arm_sve.h +420 -0
  24. package/include/avx2intrin.h +4 -5
  25. package/include/avx512bmmintrin.h +174 -0
  26. package/include/avx512bmmvlintrin.h +245 -0
  27. package/include/avx512bwintrin.h +19 -29
  28. package/include/avx512fintrin.h +62 -89
  29. package/include/avx512fp16intrin.h +12 -18
  30. package/include/avx512vbmi2intrin.h +12 -16
  31. package/include/avx512vlbwintrin.h +24 -36
  32. package/include/avx512vlintrin.h +80 -96
  33. package/include/avx512vlvbmi2intrin.h +24 -32
  34. package/include/avx512vlvnniintrin.h +29 -34
  35. package/include/avx512vnniintrin.h +32 -35
  36. package/include/avx512vp2intersectintrin.h +1 -1
  37. package/include/avxvnniintrin.h +23 -18
  38. package/include/crc32intrin.h +10 -8
  39. package/include/emmintrin.h +8 -8
  40. package/include/endian.h +91 -0
  41. package/include/fuzzer/FuzzedDataProvider.h +3 -3
  42. package/include/gpuintrin.h +123 -105
  43. package/include/hlsl_alias_intrinsics_gen.inc +3869 -0
  44. package/include/hlsl_inline_intrinsics_gen.inc +546 -0
  45. package/include/hvx_hexagon_protos.h +102 -80
  46. package/include/immintrin.h +4 -2
  47. package/include/intrin.h +20 -10
  48. package/include/larchintrin.h +2 -0
  49. package/include/llvm_libc_wrappers/ctype.h +3 -2
  50. package/include/llvm_libc_wrappers/string.h +3 -2
  51. package/include/module.modulemap +16 -1
  52. package/include/nvptxintrin.h +15 -26
  53. package/include/opencl-c-base.h +7 -0
  54. package/include/opencl-c.h +163 -102
  55. package/include/openmp_wrappers/__clang_openmp_device_functions.h +14 -0
  56. package/include/openmp_wrappers/complex +7 -1
  57. package/include/openmp_wrappers/complex.h +6 -0
  58. package/include/openmp_wrappers/math.h +10 -0
  59. package/include/profile/InstrProfData.inc +65 -3
  60. package/include/ptrauth.h +90 -12
  61. package/include/riscv_bitmanip.h +7 -0
  62. package/include/riscv_corev_alu.h +2 -0
  63. package/include/riscv_crypto.h +8 -0
  64. package/include/riscv_mips.h +2 -0
  65. package/include/riscv_nds.h +3 -0
  66. package/include/riscv_ntlh.h +2 -0
  67. package/include/riscv_packed_simd.h +644 -0
  68. package/include/riscv_vector.h +43 -0
  69. package/include/sanitizer/asan_interface.h +51 -1
  70. package/include/sanitizer/common_interface_defs.h +12 -49
  71. package/include/sanitizer/safestack_interface.h +50 -0
  72. package/include/sanitizer/tysan_interface.h +36 -0
  73. package/include/sanitizer/ubsan_interface.h +30 -0
  74. package/include/sifive_vector.h +18 -0
  75. package/include/spirvintrin.h +2 -29
  76. package/include/stdint.h +5 -14
  77. package/include/vecintrin.h +1 -1
  78. package/include/wasm_simd128.h +17 -0
  79. package/include/xmmintrin.h +8 -7
  80. package/include/zos_wrappers/grp.h +19 -0
  81. package/include/zos_wrappers/locale.h +19 -0
  82. package/include/zos_wrappers/math.h +31 -0
  83. package/include/zos_wrappers/poll.h +19 -0
  84. package/include/zos_wrappers/stdlib.h +20 -0
  85. package/include/zos_wrappers/string.h +19 -0
  86. package/include/zos_wrappers/time.h +19 -0
  87. package/include/zos_wrappers/variant.h +19 -0
  88. package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
  89. package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
  90. package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
  91. package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
  92. package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  93. package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  94. package/lib/darwin/libclang_rt.cc_kext.a +0 -0
  95. package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
  96. package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
  97. package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
  98. package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
  99. package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
  100. package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
  101. package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
  102. package/lib/darwin/libclang_rt.ios.a +0 -0
  103. package/lib/darwin/libclang_rt.iossim.a +0 -0
  104. package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
  105. package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
  106. package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
  107. package/lib/darwin/libclang_rt.osx.a +0 -0
  108. package/lib/darwin/libclang_rt.profile_ios.a +0 -0
  109. package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
  110. package/lib/darwin/libclang_rt.profile_osx.a +0 -0
  111. package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
  112. package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
  113. package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
  114. package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
  115. package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
  116. package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
  117. package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
  118. package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
  119. package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
  120. package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
  121. package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
  122. package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
  123. package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
  124. package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
  125. package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
  126. package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
  127. package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  128. package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
  129. package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
  130. package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
  131. package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
  132. package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
  133. package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
  134. package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  135. package/package.json +1 -1
  136. package/include/amxtf32intrin.h +0 -108
@@ -55,6 +55,20 @@ extern "C" {
55
55
  #pragma omp end declare variant
56
56
  #endif
57
57
 
58
+ #ifdef __SPIRV__
59
+ #pragma omp begin declare variant match( \
60
+ device = {arch(spirv64)}, implementation = {extension(match_any)})
61
+
62
+ #define __OPENMP_SPIRV__
63
+
64
+ /// Include declarations for libdevice functions.
65
+ #include <__clang_spirv_libdevice_declares.h>
66
+
67
+ #undef __OPENMP_SPIRV__
68
+
69
+ #pragma omp end declare variant
70
+ #endif
71
+
58
72
  #ifdef __cplusplus
59
73
  } // extern "C"
60
74
  #endif
@@ -29,6 +29,12 @@
29
29
  #undef __OPENMP_AMDGCN__
30
30
  #endif // __AMDGCN__
31
31
 
32
+ #ifdef __SPIRV__
33
+ #define __OPENMP_SPIRV__
34
+ #include <__clang_cuda_complex_builtins.h>
35
+ #undef __OPENMP_SPIRV__
36
+ #endif // __SPIRV__
37
+
32
38
  #endif
33
39
 
34
40
  // Grab the host header too.
@@ -45,7 +51,7 @@
45
51
  #ifndef _LIBCPP_STD_VER
46
52
 
47
53
  #pragma omp begin declare variant match( \
48
- device = {arch(amdgcn, nvptx, nvptx64)}, \
54
+ device = {arch(amdgcn, nvptx, nvptx64, spirv64)}, \
49
55
  implementation = {extension(match_any, allow_templates)})
50
56
 
51
57
  #include <complex_cmath.h>
@@ -29,6 +29,12 @@
29
29
  #undef __OPENMP_AMDGCN__
30
30
  #endif
31
31
 
32
+ #ifdef __SPIRV__
33
+ #define __OPENMP_SPIRV__
34
+ #include <__clang_cuda_complex_builtins.h>
35
+ #undef __OPENMP_SPIRV__
36
+ #endif // __SPIRV__
37
+
32
38
  #endif
33
39
 
34
40
  // Grab the host header too.
@@ -58,4 +58,14 @@
58
58
  #pragma omp end declare variant
59
59
  #endif
60
60
 
61
+ #ifdef __SPIRV__
62
+ #pragma omp begin declare variant match(device = {arch(spirv64)})
63
+
64
+ #define __OPENMP_SPIRV__
65
+ #include <__clang_spirv_math.h>
66
+ #undef __OPENMP_SPIRV__
67
+
68
+ #pragma omp end declare variant
69
+ #endif
70
+
61
71
  #endif
@@ -78,6 +78,8 @@ INSTR_PROF_DATA(const uint64_t, llvm::Type::getInt64Ty(Ctx), FuncHash, \
78
78
  ConstantInt::get(llvm::Type::getInt64Ty(Ctx), \
79
79
  Inc->getHash()->getZExtValue()))
80
80
  INSTR_PROF_DATA(const IntPtrT, IntPtrTy, CounterPtr, RelativeCounterPtr)
81
+ INSTR_PROF_DATA(const IntPtrT, IntPtrTy, UniformCounterPtr, \
82
+ RelativeUniformCounterPtr)
81
83
  INSTR_PROF_DATA(const IntPtrT, IntPtrTy, BitmapPtr, RelativeBitmapPtr)
82
84
  /* This is used to map function pointers for the indirect call targets to
83
85
  * function name hashes during the conversion from raw to merged profile
@@ -91,6 +93,10 @@ INSTR_PROF_DATA(const uint32_t, llvm::Type::getInt32Ty(Ctx), NumCounters, \
91
93
  ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumCounters))
92
94
  INSTR_PROF_DATA(const uint16_t, Int16ArrayTy, NumValueSites[IPVK_Last+1], \
93
95
  ConstantArray::get(Int16ArrayTy, Int16ArrayVals)) \
96
+ INSTR_PROF_DATA(const uint16_t, llvm::Type::getInt16Ty(Ctx), \
97
+ OffloadDeviceWaveSize, \
98
+ ConstantInt::get(llvm::Type::getInt16Ty(Ctx), \
99
+ OffloadDeviceWaveSizeVal))
94
100
  INSTR_PROF_DATA(const uint32_t, llvm::Type::getInt32Ty(Ctx), NumBitmapBytes, \
95
101
  ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumBitmapBytes))
96
102
  #undef INSTR_PROF_DATA
@@ -142,9 +148,47 @@ INSTR_PROF_VALUE_NODE(PtrToNodeT, llvm::PointerType::getUnqual(Ctx), Next, \
142
148
  #undef INSTR_PROF_VALUE_NODE
143
149
  /* INSTR_PROF_VALUE_NODE end. */
144
150
 
151
+ /* INSTR_PROF_GPU_SECT start. */
152
+ /* Fields of the GPU profile section bounds structure, populated by the
153
+ * compiler runtime and read by the host to extract profiling data. */
154
+ #ifndef INSTR_PROF_GPU_SECT
155
+ #define INSTR_PROF_GPU_SECT(Type, LLVMType, Name, Initializer)
156
+ #else
157
+ #define INSTR_PROF_DATA_DEFINED
158
+ #endif
159
+ INSTR_PROF_GPU_SECT(const char *, llvm::PointerType::getUnqual(Ctx), \
160
+ NamesStart, \
161
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
162
+ INSTR_PROF_GPU_SECT(const char *, llvm::PointerType::getUnqual(Ctx), \
163
+ NamesStop, \
164
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
165
+ INSTR_PROF_GPU_SECT(char *, llvm::PointerType::getUnqual(Ctx), \
166
+ CountersStart, \
167
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
168
+ INSTR_PROF_GPU_SECT(char *, llvm::PointerType::getUnqual(Ctx), \
169
+ CountersStop, \
170
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
171
+ INSTR_PROF_GPU_SECT(const __llvm_profile_data *, llvm::PointerType::getUnqual( \
172
+ Ctx), DataStart, \
173
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
174
+ INSTR_PROF_GPU_SECT(const __llvm_profile_data *, llvm::PointerType::getUnqual( \
175
+ Ctx), DataStop, \
176
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
177
+ INSTR_PROF_GPU_SECT(char *, llvm::PointerType::getUnqual(Ctx), \
178
+ UniformCountersStart, \
179
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
180
+ INSTR_PROF_GPU_SECT(char *, llvm::PointerType::getUnqual(Ctx), \
181
+ UniformCountersStop, \
182
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
183
+ INSTR_PROF_GPU_SECT(uint64_t *, llvm::PointerType::getUnqual(Ctx), \
184
+ VersionVar, \
185
+ ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx)))
186
+ #undef INSTR_PROF_GPU_SECT
187
+ /* INSTR_PROF_GPU_SECT end. */
188
+
145
189
  /* INSTR_PROF_RAW_HEADER start */
146
190
  /* Definition of member fields of the raw profile header data structure. */
147
- /* Please update llvm/docs/InstrProfileFormat.rst as appropriate when updating
191
+ /* Please update llvm/docs/InstrProfileFormat.md as appropriate when updating
148
192
  raw profile format. */
149
193
  #ifndef INSTR_PROF_RAW_HEADER
150
194
  #define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
@@ -160,6 +204,12 @@ INSTR_PROF_RAW_HEADER(uint64_t, NumCounters, NumCounters)
160
204
  INSTR_PROF_RAW_HEADER(uint64_t, PaddingBytesAfterCounters, PaddingBytesAfterCounters)
161
205
  INSTR_PROF_RAW_HEADER(uint64_t, NumBitmapBytes, NumBitmapBytes)
162
206
  INSTR_PROF_RAW_HEADER(uint64_t, PaddingBytesAfterBitmapBytes, PaddingBytesAfterBitmapBytes)
207
+ INSTR_PROF_RAW_HEADER(uint64_t, NumUniformCounters, NumUniformCounters)
208
+ INSTR_PROF_RAW_HEADER(uint64_t, PaddingBytesAfterUniformCounters, PaddingBytesAfterUniformCounters)
209
+ INSTR_PROF_RAW_HEADER(uint64_t, UniformCountersDelta,
210
+ UniformCountersBegin ? (uintptr_t)UniformCountersBegin -
211
+ (uintptr_t)DataBegin
212
+ : 0)
163
213
  INSTR_PROF_RAW_HEADER(uint64_t, NamesSize, NamesSize)
164
214
  INSTR_PROF_RAW_HEADER(uint64_t, CountersDelta,
165
215
  (uintptr_t)CountersBegin - (uintptr_t)DataBegin)
@@ -324,6 +374,9 @@ INSTR_PROF_SECT_ENTRY(IPSK_data, \
324
374
  INSTR_PROF_SECT_ENTRY(IPSK_cnts, \
325
375
  INSTR_PROF_QUOTE(INSTR_PROF_CNTS_COMMON), \
326
376
  INSTR_PROF_CNTS_COFF, "__DATA,")
377
+ INSTR_PROF_SECT_ENTRY(IPSK_ucnts, \
378
+ INSTR_PROF_QUOTE(INSTR_PROF_UCNTS_COMMON), \
379
+ INSTR_PROF_UCNTS_COFF, "__DATA,")
327
380
  INSTR_PROF_SECT_ENTRY(IPSK_bitmap, \
328
381
  INSTR_PROF_QUOTE(INSTR_PROF_BITS_COMMON), \
329
382
  INSTR_PROF_BITS_COFF, "__DATA,")
@@ -720,9 +773,9 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
720
773
  (uint64_t)'f' << 16 | (uint64_t)'R' << 8 | (uint64_t)129
721
774
 
722
775
  /* Raw profile format version (start from 1). */
723
- #define INSTR_PROF_RAW_VERSION 10
776
+ #define INSTR_PROF_RAW_VERSION 11
724
777
  /* Indexed profile format version (start from 1). */
725
- #define INSTR_PROF_INDEX_VERSION 13
778
+ #define INSTR_PROF_INDEX_VERSION 14
726
779
  /* Coverage mapping format version (start from 0). */
727
780
  #define INSTR_PROF_COVMAP_VERSION 6
728
781
 
@@ -761,12 +814,17 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
761
814
  * specified via command line. */
762
815
  #define INSTR_PROF_PROFILE_NAME_VAR __llvm_profile_filename
763
816
 
817
+ /* GPU profiling section bounds structure, populated by the compiler runtime
818
+ * and read by the host to extract profiling data. */
819
+ #define INSTR_PROF_SECT_BOUNDS_TABLE __llvm_profile_sections
820
+
764
821
  /* section name strings common to all targets other
765
822
  than WIN32 */
766
823
  #define INSTR_PROF_DATA_COMMON __llvm_prf_data
767
824
  #define INSTR_PROF_NAME_COMMON __llvm_prf_names
768
825
  #define INSTR_PROF_VNAME_COMMON __llvm_prf_vns
769
826
  #define INSTR_PROF_CNTS_COMMON __llvm_prf_cnts
827
+ #define INSTR_PROF_UCNTS_COMMON __llvm_prf_ucnts
770
828
  #define INSTR_PROF_BITS_COMMON __llvm_prf_bits
771
829
  #define INSTR_PROF_VALS_COMMON __llvm_prf_vals
772
830
  #define INSTR_PROF_VNODES_COMMON __llvm_prf_vnds
@@ -784,6 +842,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
784
842
  #define INSTR_PROF_NAME_COFF ".lprfn$M"
785
843
  #define INSTR_PROF_VNAME_COFF ".lprfvn$M"
786
844
  #define INSTR_PROF_CNTS_COFF ".lprfc$M"
845
+ #define INSTR_PROF_UCNTS_COFF ".lprfuc$M"
787
846
  #define INSTR_PROF_BITS_COFF ".lprfb$M"
788
847
  #define INSTR_PROF_VALS_COFF ".lprfv$M"
789
848
  #define INSTR_PROF_VNODES_COFF ".lprfnd$M"
@@ -857,6 +916,9 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
857
916
  #define INSTR_PROF_VALUE_PROF_MEMOP_FUNC __llvm_profile_instrument_memop
858
917
  #define INSTR_PROF_VALUE_PROF_MEMOP_FUNC_STR \
859
918
  INSTR_PROF_QUOTE(INSTR_PROF_VALUE_PROF_MEMOP_FUNC)
919
+ #define INSTR_PROF_INSTRUMENT_GPU_FUNC __llvm_profile_instrument_gpu
920
+ #define INSTR_PROF_INSTRUMENT_GPU_FUNC_STR \
921
+ INSTR_PROF_QUOTE(INSTR_PROF_INSTRUMENT_GPU_FUNC)
860
922
 
861
923
  /* InstrProfile per-function control data alignment. */
862
924
  #define INSTR_PROF_DATA_ALIGNMENT 8
package/include/ptrauth.h CHANGED
@@ -38,8 +38,7 @@ typedef enum {
38
38
  The extra data is always 0. */
39
39
  ptrauth_key_function_pointer = ptrauth_key_process_independent_code,
40
40
 
41
- /* The key used to sign C++ v-table pointers.
42
- The extra data is always 0. */
41
+ /* The key used to sign pointers to C++ v-tables. */
43
42
  ptrauth_key_cxx_vtable_pointer = ptrauth_key_process_independent_data,
44
43
 
45
44
  /* The key used to sign metadata pointers to Objective-C method-lists. */
@@ -178,6 +177,56 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
178
177
  __builtin_ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \
179
178
  __new_data)
180
179
 
180
+ /* Authenticate a pointer using a PC-based signature scheme and resign
181
+ it using a different scheme.
182
+
183
+ If the result is subsequently authenticated using the new scheme, that
184
+ authentication is guaranteed to fail if and only if the initial
185
+ authentication failed.
186
+
187
+ The value must be an expression of pointer type.
188
+ The key must be a constant expression of type ptrauth_key.
189
+ The extra data must be an expression of pointer or integer type;
190
+ if an integer, it will be coerced to ptrauth_extra_data_t.
191
+ The oldpc must be an expression of pointer or integer type representing
192
+ the PC value where the original signature was created.
193
+ The result will have the same type as the original value.
194
+
195
+ This operation is guaranteed to not leave the intermediate value
196
+ available for attack before it is re-signed.
197
+
198
+ Do not pass a null pointer to this function. A null pointer
199
+ will not successfully authenticate. */
200
+ #define ptrauth_auth_with_pc_and_resign(__value, __old_key, __old_data, \
201
+ __old_pc, __new_key, __new_data) \
202
+ __builtin_ptrauth_auth_with_pc_and_resign(__value, __old_key, __old_data, \
203
+ __old_pc, __new_key, __new_data)
204
+
205
+ /* Authenticate a pointer using one scheme, load 32bit value at offset addend
206
+ from the pointer, and add this value to the pointer, sign using specified
207
+ scheme.
208
+
209
+ If the result is subsequently authenticated using the new scheme, that
210
+ authentication is guaranteed to fail if and only if the initial
211
+ authentication failed.
212
+
213
+ The value must be an expression of pointer type.
214
+ The key must be a constant expression of type ptrauth_key.
215
+ The extra data must be an expression of pointer or integer type;
216
+ if an integer, it will be coerced to ptrauth_extra_data_t.
217
+ The addend must be an immediate ptrdiff_t value.
218
+ The result will have the same type as the original value.
219
+
220
+ This operation is guaranteed to not leave the intermediate value
221
+ available for attack before it is re-signed.
222
+
223
+ Do not pass a null pointer to this function. A null pointer
224
+ will not successfully authenticate. */
225
+ #define ptrauth_auth_load_relative_and_sign(__value, __old_key, __old_data, \
226
+ __new_key, __new_data, __offset) \
227
+ __builtin_ptrauth_auth_load_relative_and_sign( \
228
+ __value, __old_key, __old_data, __new_key, __new_data, __offset)
229
+
181
230
  /* Authenticate a pointer using one scheme and resign it as a C
182
231
  function pointer.
183
232
 
@@ -324,30 +373,38 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
324
373
  __ptrauth(ptrauth_key_objc_class_ro_pointer, 1, \
325
374
  __ptrauth_objc_class_ro_discriminator)
326
375
 
376
+ #if __has_feature(ptrauth_init_fini_address_discrimination)
377
+ #define __ptrauth_init_fini_pointer \
378
+ __ptrauth(ptrauth_key_init_fini_pointer, 1, __ptrauth_init_fini_discriminator)
379
+ #else
380
+ #define __ptrauth_init_fini_pointer \
381
+ __ptrauth(ptrauth_key_init_fini_pointer, 0, __ptrauth_init_fini_discriminator)
382
+ #endif
383
+
327
384
  #else
328
385
 
329
386
  #define ptrauth_strip(__value, __key) \
330
- ({ \
387
+ __extension__({ \
331
388
  (void)__key; \
332
389
  __value; \
333
390
  })
334
391
 
335
392
  #define ptrauth_blend_discriminator(__pointer, __integer) \
336
- ({ \
393
+ __extension__({ \
337
394
  (void)__pointer; \
338
395
  (void)__integer; \
339
396
  ((ptrauth_extra_data_t)0); \
340
397
  })
341
398
 
342
399
  #define ptrauth_sign_constant(__value, __key, __data) \
343
- ({ \
400
+ __extension__({ \
344
401
  (void)__key; \
345
402
  (void)__data; \
346
403
  __value; \
347
404
  })
348
405
 
349
406
  #define ptrauth_sign_unauthenticated(__value, __key, __data) \
350
- ({ \
407
+ __extension__({ \
351
408
  (void)__key; \
352
409
  (void)__data; \
353
410
  __value; \
@@ -355,7 +412,7 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
355
412
 
356
413
  #define ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \
357
414
  __new_data) \
358
- ({ \
415
+ __extension__({ \
359
416
  (void)__old_key; \
360
417
  (void)__old_data; \
361
418
  (void)__new_key; \
@@ -363,22 +420,44 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
363
420
  __value; \
364
421
  })
365
422
 
423
+ #define ptrauth_auth_with_pc_and_resign(__value, __old_key, __old_data, \
424
+ __old_pc, __new_key, __new_data) \
425
+ __extension__({ \
426
+ (void)__old_key; \
427
+ (void)__old_data; \
428
+ (void)__old_pc; \
429
+ (void)__new_key; \
430
+ (void)__new_data; \
431
+ __value; \
432
+ })
433
+
434
+ #define ptrauth_auth_load_relative_and_sign(__value, __old_key, __old_data, \
435
+ __new_key, __new_data, __offset) \
436
+ __extension__({ \
437
+ (void)__old_key; \
438
+ (void)__old_data; \
439
+ (void)__new_key; \
440
+ (void)__new_data; \
441
+ const char *__value_tmp = (const char *)(__value); \
442
+ (void *)(__value_tmp + *(const int *)(__value_tmp + (__offset))); \
443
+ })
444
+
366
445
  #define ptrauth_auth_function(__value, __old_key, __old_data) \
367
- ({ \
446
+ __extension__({ \
368
447
  (void)__old_key; \
369
448
  (void)__old_data; \
370
449
  __value; \
371
450
  })
372
451
 
373
452
  #define ptrauth_auth_data(__value, __old_key, __old_data) \
374
- ({ \
453
+ __extension__({ \
375
454
  (void)__old_key; \
376
455
  (void)__old_data; \
377
456
  __value; \
378
457
  })
379
458
 
380
459
  #define ptrauth_string_discriminator(__string) \
381
- ({ \
460
+ __extension__({ \
382
461
  (void)__string; \
383
462
  ((ptrauth_extra_data_t)0); \
384
463
  })
@@ -388,13 +467,12 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
388
467
  ((ptrauth_extra_data_t)0)
389
468
 
390
469
  #define ptrauth_sign_generic_data(__value, __data) \
391
- ({ \
470
+ __extension__({ \
392
471
  (void)__value; \
393
472
  (void)__data; \
394
473
  ((ptrauth_generic_signature_t)0); \
395
474
  })
396
475
 
397
-
398
476
  #define ptrauth_cxx_vtable_pointer(key, address_discrimination, \
399
477
  extra_discrimination...)
400
478
 
@@ -16,6 +16,13 @@
16
16
  extern "C" {
17
17
  #endif
18
18
 
19
+ #define __riscv_intrinsic_b 1
20
+ #define __riscv_intrinsic_zbb 1
21
+ #define __riscv_intrinsic_zbc 1
22
+ #define __riscv_intrinsic_zbkb 1
23
+ #define __riscv_intrinsic_zbkc 1
24
+ #define __riscv_intrinsic_zbkx 1
25
+
19
26
  #if defined(__riscv_zbb)
20
27
  static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
21
28
  __riscv_orc_b_32(uint32_t __x) {
@@ -16,6 +16,8 @@
16
16
  extern "C" {
17
17
  #endif
18
18
 
19
+ #define __riscv_intrinsic_xcvalu 1
20
+
19
21
  #if defined(__riscv_xcvalu)
20
22
 
21
23
  #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
@@ -16,6 +16,14 @@
16
16
  extern "C" {
17
17
  #endif
18
18
 
19
+ #define __riscv_intrinsic_zkn 1
20
+ #define __riscv_intrinsic_zknd 1
21
+ #define __riscv_intrinsic_zkne 1
22
+ #define __riscv_intrinsic_zknh 1
23
+ #define __riscv_intrinsic_zks 1
24
+ #define __riscv_intrinsic_zksed 1
25
+ #define __riscv_intrinsic_zksh 1
26
+
19
27
  #if defined(__riscv_zknd)
20
28
  #if __riscv_xlen == 32
21
29
  #define __riscv_aes32dsi(x, y, bs) __builtin_riscv_aes32dsi(x, y, bs)
@@ -14,6 +14,8 @@
14
14
  #error "This header is only meant to be used on riscv architecture"
15
15
  #endif
16
16
 
17
+ #define __riscv_intrinsic_xmipsexectl 1
18
+
17
19
  #define __DEFAULT_FN_ATTRS \
18
20
  __attribute__((__always_inline__, __nodebug__, __target__("xmipsexectl")))
19
21
 
@@ -16,6 +16,9 @@
16
16
  extern "C" {
17
17
  #endif
18
18
 
19
+ #define __riscv_intrinsic_xandesbfhcvt 1
20
+ #define __riscv_intrinsic_xandesperf 1
21
+
19
22
  #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
20
23
 
21
24
  #if defined(__riscv_xandesperf)
@@ -10,6 +10,8 @@
10
10
  #ifndef __RISCV_NTLH_H
11
11
  #define __RISCV_NTLH_H
12
12
 
13
+ #define __riscv_intrinsic_zihintntl 1
14
+
13
15
  #ifndef __riscv_zihintntl
14
16
  #error "NTLH intrinsics require the NTLH extension."
15
17
  #endif