[clang] [NFC] Cleanup and sort hlsl_intrinsics.h (PR #72414)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 12:52:13 PST 2023


================
@@ -11,557 +11,614 @@
 
 namespace hlsl {
 
-__attribute__((availability(shadermodel, introduced = 6.0)))
-__attribute__((clang_builtin_alias(__builtin_hlsl_wave_active_count_bits))) uint
-WaveActiveCountBits(bool bBit);
+// Note: Functions in this file are sorted alphabetically, then grouped by base
+// element type, and the element types are sorted by size, then singed integer,
+// unsigned integer and floating point. Keeping this ordering consistent will
+// help keep this file manageable as it grows.
 
+#define _HLSL_BUILTIN_ALIAS(builtin)                                           \
----------------
llvm-beanz wrote:

It being reserved is the point here. `_<capital letter>` macros are reserved for use by the compiler. This header is part of the compiler implementation. It ships with the compiler and is tied to it.

We could alternatively move this definition into the actual compiler code (like under InitPreprocessor), but that would be harder to maintain. We do similar things in the `__cuda_*` headers in the parent directory of this header as well as the target-specific intrinsic headers (see: https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/xmmintrin.h#L2076)

https://github.com/llvm/llvm-project/pull/72414


More information about the cfe-commits mailing list