[clang] [HLSL] Shore up floating point conversions (PR #90222)

S. Bharadwaj Yadavalli via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 12:01:54 PDT 2024


================
@@ -2616,6 +2617,13 @@ bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) {
            ToBuiltin->getKind() == BuiltinType::Ibm128))
         return true;
 
+      // In HLSL, `half` promotes to `float` or `double`, regardless of whether
+      // or not native half types are enabled.
----------------
bharadwajy wrote:

It appears that `half` is represented as LLVM IR type `half` with `-enable-16bit-types` option specified and is promoted to `float` without it being specified per [this](https://godbolt.org/z/53qc3a9PY).

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


More information about the cfe-commits mailing list