[clang] Adding `asuint` implementation to hlsl (PR #107292)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 12:16:00 PDT 2024


================
@@ -387,6 +387,65 @@ float3 asin(float3);
 _HLSL_BUILTIN_ALIAS(__builtin_elementwise_asin)
 float4 asin(float4);
 
+//===----------------------------------------------------------------------===//
+// asuint builtins
+//===----------------------------------------------------------------------===//
+
+/// \fn uint asuint(T Val)
+/// \brief Interprets the bit pattern of x as an unsigned integer.
+/// \param Val The input value.
+
+__attribute__((__always_inline__, __nodebug__)) static inline uint
----------------
farzonl wrote:

I don't really like how dissimilar this looks to all the other intrinsics. Maybe we could capture these new attributes in a new preprocessor macro. Something like `_HLSL_CAST_BUILTIN_ALIAS`? 

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


More information about the cfe-commits mailing list