================ @@ -89,23 +89,31 @@ void asuint(double4, out uint4, out uint4); /// \param X The X input value. /// \param Y The Y input value. +template <typename T> _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) -const inline half distance(half X, half Y) { +const inline __detail::enable_if_t<__detail::is_arithmetic<T>::Value && ---------------- farzonl wrote:
Yeah I didn't want to templatize the scalar case, but what I found out was if I didn't then the vectors of any size would cast themselves down to scalars. The `is_arithmetic` here is to check the type coming in is already a scalar. The annoying thing for this case was I needed to distinguish the float and half scalar templates to be able to apply `_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)` and thats why the `is_same` stuff is here. https://github.com/llvm/llvm-project/pull/130724 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits