[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

Sarah Spall via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 15:11:45 PST 2025


================
@@ -1678,6 +1678,30 @@ half3 max(half3, half3);
 _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
 _HLSL_BUILTIN_ALIAS(__builtin_elementwise_max)
 half4 max(half4, half4);
+_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
+constexpr half2 max(half2 p0, half p1) {
----------------
spall wrote:

We only want to allow things of the form max(vector<T,N>, T) or max(T, vector<T,N>)

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


More information about the cfe-commits mailing list