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

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 11:03:11 PDT 2024


joaosaffran wrote:

After discussing with @bogner and @farzonl, we decided the following: 

- Using `static_assert` for the errors makes the user experience inconsistent, since we expect the type checking to happen in `SemaHLSL.cpp`, as other builtins.
- The 16 bit casts don't have this problem (because that would be a lossy conversion).
- Therefore, we should introduce a builtin for hlsl-specific 32-bit casts, this can be reused to implement `asfloat`.

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


More information about the cfe-commits mailing list