[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)
Kaitlin Peng via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 3 15:51:08 PDT 2025
================
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===----------------------------------------------------------------------===//
+// lit builtins overloads
+//===----------------------------------------------------------------------===//
+
+template <typename T>
+constexpr __detail::enable_if_t<__detail::is_arithmetic<T>::Value &&
+ (__detail::is_same<double, T>::value ||
----------------
kmpeng wrote:
The ambiguous error doesn't appear, but the half definition in `hlsl_instrinsics.h` doesn't seem to be used anymore when we're only checking `__detail::is_arithmetic<T>` in the overloads. The tablegen shows half inputs being casted to floats and then the float definition of `lit` being called.
https://github.com/llvm/llvm-project/pull/134171
More information about the cfe-commits
mailing list