https://github.com/llvm-beanz commented:

One question I have about this is do we actually need new builtins? These are 
just doing bit casts correct?

Could we implement them entirely in the header? Something like:

```hlsl
template <typename T, typename U>
T bit_cast(U Val) { return __builtin_bit_cast(T, Val); }

uint asuint(float F) { return bit_cast<uint>(F); }
```

This seems to work for me in godbolt: https://godbolt.org/z/8b61a1WMr

We may want to apply the `[[alwaysinline]]` attribute, but it seems like a 
reasonable approach. Thoughts?



https://github.com/llvm/llvm-project/pull/107292
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to