[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)
Damyan Pepper via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 29 14:53:21 PDT 2025
================
@@ -106,3 +102,17 @@ float3 test_lerp_uint64_t3(uint64_t3 p0) { return lerp(p0, p0, p0); }
// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
// CHECK: ret <4 x float> %hlsl.lerp
float4 test_lerp_uint64_t4(uint64_t4 p0) { return lerp(p0, p0, p0); }
+
+// CHECK-LABEL: test_lerp_half_scalar
+// NATIVE_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.[[TARGET]].lerp.v3f16(<3 x half> %{{.*}}, <3 x half> %{{.*}}, <3 x half> %{{.*}})
+// NATIVE_HALF: ret <3 x half> %hlsl.lerp
+// NO_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})
+// NO_HALF: ret <3 x float> %hlsl.lerp
+half3 test_lerp_half_scalar(half3 x, half3 y, half s) { return lerp(x, y, s); }
----------------
damyanp wrote:
Would we not want something to see how `s` gets turned into a `3 x float`, or is that exercised enough elsewhere?
https://github.com/llvm/llvm-project/pull/137877
More information about the cfe-commits
mailing list