[clang] [HLSL] Add various overloads for MiniEngine (PR #139800)

Sarah Spall via cfe-commits cfe-commits at lists.llvm.org
Tue May 13 15:01:53 PDT 2025


================
@@ -179,3 +179,41 @@ half3 test_lerp_half_scalar(half3 x, half3 y, half s) { return lerp(x, y, s); }
 float3 test_lerp_float_scalar(float3 x, float3 y, float s) {
   return lerp(x, y, s);
 }
+
+// CHECK: define [[FNATTRS]] <2 x float> @_Z23test_lerp_float_scalar1Dv2_ff(
+// CHECK:    [[SPLATINSERT:%.*]] = insertelement <2 x float> poison, float %{{.*}}, i64 0
+// CHECK:    [[SPLAT:%.*]] = shufflevector <2 x float> [[SPLATINSERT]], <2 x float> poison, <2 x i32> zeroinitializer
+// CHECK:    [[LERP:%.*]] = call {{.*}} <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> {{.*}}, <2 x float> {{.*}}, <2 x float> [[SPLAT]])
+// CHECK:    ret <2 x float> [[LERP]]
+float2 test_lerp_float_scalar1(float2 v, float s) {
----------------
spall wrote:

is this test worth adding since its a duplicate of the one above, just uses float2 instead of float3?

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


More information about the cfe-commits mailing list