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

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 10 15:01:41 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
----------------
joaosaffran wrote:

I think there might be some things we are unaware of right now. I think we can use the macros to host the attributes, or help us do some of the `static_cast`.  In the future, once we've implemented more of the casting functionality, we can reassess and see if there is more boilerplate that can be moved into the macro.

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


More information about the cfe-commits mailing list