================
@@ -65,3 +65,65 @@ float64x2_t test_vfmaq_f64(float64x2_t a, float64x2_t b,
float64x2_t c) {
// LLVM-NEXT: ret <2 x double> [[FMA]]
return vfmaq_f64(a, b, c);
}
+
+// LLVM-LABEL: @test_vfmaq_lane_f32(
+// CIR-LABEL: @test_vfmaq_lane_f32(
+float32x4_t test_vfmaq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) {
+// CIR: [[LANE:%.*]] = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<2 x
!cir.float>) [#cir.int<1> : !s32i, #cir.int<1> : !s32i, #cir.int<1> : !s32i,
#cir.int<1> : !s32i] : !cir.vector<4 x !cir.float>
+// CIR: cir.call_llvm_intrinsic "fma" %{{.*}}, [[LANE]], %{{.*}} :
(!cir.vector<4 x !cir.float>, !cir.vector<4 x !cir.float>, !cir.vector<4 x
!cir.float>) -> !cir.vector<4 x !cir.float>
+
+// LLVM-SAME: <4 x float> {{.*}} [[A:%.*]], <4 x float> {{.*}} [[B:%.*]], <2 x
float> {{.*}} [[V:%.*]]) {{.*}} {
+// LLVM: [[A_I:%.*]] = bitcast <4 x float> [[A]] to <4 x i32>
+// LLVM-NEXT: [[B_I:%.*]] = bitcast <4 x float> [[B]] to <4 x i32>
+// LLVM-NEXT: [[V_I:%.*]] = bitcast <2 x float> [[V]] to <2 x i32>
+// LLVM-NEXT: [[A_BYTES:%.*]] = bitcast <4 x i32> [[A_I]] to <16 x i8>
+// LLVM-NEXT: [[B_BYTES:%.*]] = bitcast <4 x i32> [[B_I]] to <16 x i8>
+// LLVM-NEXT: [[V_BYTES:%.*]] = bitcast <2 x i32> [[V_I]] to <8 x i8>
+// LLVM: [[V_CAST:%.*]] = bitcast <8 x i8> [[V_BYTES]] to <2 x float>
+// LLVM-NEXT: [[LANE:%.*]] = shufflevector <2 x float> [[V_CAST]], <2 x float>
{{.*}}, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
+// LLVM: [[FMA:%.*]] = call <4 x float> @llvm.fma.v4f32(<4 x float>
%{{.*}}, <4 x float> [[LANE]], <4 x float> %{{.*}})
+// LLVM: ret <4 x float> [[FMA]]
+ return vfmaq_lane_f32(a, b, v, 1);
----------------
yairbenavraham wrote:
This one I don't understand, isn't 123 out of range?
https://github.com/llvm/llvm-project/pull/197084
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits