[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:32:51 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); }
----------------
spall wrote:
Yes, I just didn't want to add tons of tests; I also didn't add a test for each size of vector, only the vec4s. I can add more tests if you think its important.
https://github.com/llvm/llvm-project/pull/129334
More information about the cfe-commits
mailing list