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

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 15:18:34 PST 2025


================
@@ -131,3 +157,9 @@ double3 test_min_double3(double3 p0, double3 p1) { return min(p0, p1); }
 // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> @_Z16test_min_double4
 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64
 double4 test_min_double4(double4 p0, double4 p1) { return min(p0, p1); }
+// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> {{.*}}test_min_double4_mismatch
+// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64
+double4 test_min_double4_mismatch(double4 p0, double p1) { return min(p0, p1); }
+// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> {{.*}}test_min_double4_mismatch2
+// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64
+double4 test_min_double4_mismatch2(double4 p0, double p1) { return min(p1, p0); }
----------------
bob80905 wrote:

Shouldn't this parameter swap test be applicable to all the rest of the tests? Why just double?

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


More information about the cfe-commits mailing list