xref: /aosp_15_r20/external/clang/test/CodeGen/aarch64-neon-fma.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
2*67e74705SXin Li 
3*67e74705SXin Li // Test new aarch64 intrinsics and types
4*67e74705SXin Li 
5*67e74705SXin Li #include <arm_neon.h>
6*67e74705SXin Li 
7*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmla_n_f32(<2 x float> %a, <2 x float> %b, float %c) #0 {
8*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x float> undef, float %c, i32 0
9*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x float> [[VECINIT_I]], float %c, i32 1
10*67e74705SXin Li // CHECK:   [[MUL_I:%.*]] = fmul <2 x float> %b, [[VECINIT1_I]]
11*67e74705SXin Li // CHECK:   [[ADD_I:%.*]] = fadd <2 x float> %a, [[MUL_I]]
12*67e74705SXin Li // CHECK:   ret <2 x float> [[ADD_I]]
test_vmla_n_f32(float32x2_t a,float32x2_t b,float32_t c)13*67e74705SXin Li float32x2_t test_vmla_n_f32(float32x2_t a, float32x2_t b, float32_t c) {
14*67e74705SXin Li   return vmla_n_f32(a, b, c);
15*67e74705SXin Li }
16*67e74705SXin Li 
17*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlaq_n_f32(<4 x float> %a, <4 x float> %b, float %c) #0 {
18*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <4 x float> undef, float %c, i32 0
19*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float %c, i32 1
20*67e74705SXin Li // CHECK:   [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float %c, i32 2
21*67e74705SXin Li // CHECK:   [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float %c, i32 3
22*67e74705SXin Li // CHECK:   [[MUL_I:%.*]] = fmul <4 x float> %b, [[VECINIT3_I]]
23*67e74705SXin Li // CHECK:   [[ADD_I:%.*]] = fadd <4 x float> %a, [[MUL_I]]
24*67e74705SXin Li // CHECK:   ret <4 x float> [[ADD_I]]
test_vmlaq_n_f32(float32x4_t a,float32x4_t b,float32_t c)25*67e74705SXin Li float32x4_t test_vmlaq_n_f32(float32x4_t a, float32x4_t b, float32_t c) {
26*67e74705SXin Li   return vmlaq_n_f32(a, b, c);
27*67e74705SXin Li }
28*67e74705SXin Li 
29*67e74705SXin Li // CHECK-LABEL: define <2 x double> @test_vmlaq_n_f64(<2 x double> %a, <2 x double> %b, double %c) #0 {
30*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %c, i32 0
31*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %c, i32 1
32*67e74705SXin Li // CHECK:   [[MUL_I:%.*]] = fmul <2 x double> %b, [[VECINIT1_I]]
33*67e74705SXin Li // CHECK:   [[ADD_I:%.*]] = fadd <2 x double> %a, [[MUL_I]]
34*67e74705SXin Li // CHECK:   ret <2 x double> [[ADD_I]]
test_vmlaq_n_f64(float64x2_t a,float64x2_t b,float64_t c)35*67e74705SXin Li float64x2_t test_vmlaq_n_f64(float64x2_t a, float64x2_t b, float64_t c) {
36*67e74705SXin Li   return vmlaq_n_f64(a, b, c);
37*67e74705SXin Li }
38*67e74705SXin Li 
39*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlsq_n_f32(<4 x float> %a, <4 x float> %b, float %c) #0 {
40*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <4 x float> undef, float %c, i32 0
41*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float %c, i32 1
42*67e74705SXin Li // CHECK:   [[VECINIT2_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float %c, i32 2
43*67e74705SXin Li // CHECK:   [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT2_I]], float %c, i32 3
44*67e74705SXin Li // CHECK:   [[MUL_I:%.*]] = fmul <4 x float> %b, [[VECINIT3_I]]
45*67e74705SXin Li // CHECK:   [[SUB_I:%.*]] = fsub <4 x float> %a, [[MUL_I]]
46*67e74705SXin Li // CHECK:   ret <4 x float> [[SUB_I]]
test_vmlsq_n_f32(float32x4_t a,float32x4_t b,float32_t c)47*67e74705SXin Li float32x4_t test_vmlsq_n_f32(float32x4_t a, float32x4_t b, float32_t c) {
48*67e74705SXin Li   return vmlsq_n_f32(a, b, c);
49*67e74705SXin Li }
50*67e74705SXin Li 
51*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmls_n_f32(<2 x float> %a, <2 x float> %b, float %c) #0 {
52*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x float> undef, float %c, i32 0
53*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x float> [[VECINIT_I]], float %c, i32 1
54*67e74705SXin Li // CHECK:   [[MUL_I:%.*]] = fmul <2 x float> %b, [[VECINIT1_I]]
55*67e74705SXin Li // CHECK:   [[SUB_I:%.*]] = fsub <2 x float> %a, [[MUL_I]]
56*67e74705SXin Li // CHECK:   ret <2 x float> [[SUB_I]]
test_vmls_n_f32(float32x2_t a,float32x2_t b,float32_t c)57*67e74705SXin Li float32x2_t test_vmls_n_f32(float32x2_t a, float32x2_t b, float32_t c) {
58*67e74705SXin Li   return vmls_n_f32(a, b, c);
59*67e74705SXin Li }
60*67e74705SXin Li 
61*67e74705SXin Li // CHECK-LABEL: define <2 x double> @test_vmlsq_n_f64(<2 x double> %a, <2 x double> %b, double %c) #0 {
62*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %c, i32 0
63*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %c, i32 1
64*67e74705SXin Li // CHECK:   [[MUL_I:%.*]] = fmul <2 x double> %b, [[VECINIT1_I]]
65*67e74705SXin Li // CHECK:   [[SUB_I:%.*]] = fsub <2 x double> %a, [[MUL_I]]
66*67e74705SXin Li // CHECK:   ret <2 x double> [[SUB_I]]
test_vmlsq_n_f64(float64x2_t a,float64x2_t b,float64_t c)67*67e74705SXin Li float64x2_t test_vmlsq_n_f64(float64x2_t a, float64x2_t b, float64_t c) {
68*67e74705SXin Li   return vmlsq_n_f64(a, b, c);
69*67e74705SXin Li }
70*67e74705SXin Li 
71*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmla_lane_f32_0(<2 x float> %a, <2 x float> %b, <2 x float> %v) #0 {
72*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <2 x i32> zeroinitializer
73*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
74*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <2 x float> %a, [[MUL]]
75*67e74705SXin Li // CHECK:   ret <2 x float> [[ADD]]
test_vmla_lane_f32_0(float32x2_t a,float32x2_t b,float32x2_t v)76*67e74705SXin Li float32x2_t test_vmla_lane_f32_0(float32x2_t a, float32x2_t b, float32x2_t v) {
77*67e74705SXin Li   return vmla_lane_f32(a, b, v, 0);
78*67e74705SXin Li }
79*67e74705SXin Li 
80*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlaq_lane_f32_0(<4 x float> %a, <4 x float> %b, <2 x float> %v) #0 {
81*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <4 x i32> zeroinitializer
82*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
83*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <4 x float> %a, [[MUL]]
84*67e74705SXin Li // CHECK:   ret <4 x float> [[ADD]]
test_vmlaq_lane_f32_0(float32x4_t a,float32x4_t b,float32x2_t v)85*67e74705SXin Li float32x4_t test_vmlaq_lane_f32_0(float32x4_t a, float32x4_t b, float32x2_t v) {
86*67e74705SXin Li   return vmlaq_lane_f32(a, b, v, 0);
87*67e74705SXin Li }
88*67e74705SXin Li 
89*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmla_laneq_f32_0(<2 x float> %a, <2 x float> %b, <4 x float> %v) #0 {
90*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <2 x i32> zeroinitializer
91*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
92*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <2 x float> %a, [[MUL]]
93*67e74705SXin Li // CHECK:   ret <2 x float> [[ADD]]
test_vmla_laneq_f32_0(float32x2_t a,float32x2_t b,float32x4_t v)94*67e74705SXin Li float32x2_t test_vmla_laneq_f32_0(float32x2_t a, float32x2_t b, float32x4_t v) {
95*67e74705SXin Li   return vmla_laneq_f32(a, b, v, 0);
96*67e74705SXin Li }
97*67e74705SXin Li 
98*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlaq_laneq_f32_0(<4 x float> %a, <4 x float> %b, <4 x float> %v) #0 {
99*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <4 x i32> zeroinitializer
100*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
101*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <4 x float> %a, [[MUL]]
102*67e74705SXin Li // CHECK:   ret <4 x float> [[ADD]]
test_vmlaq_laneq_f32_0(float32x4_t a,float32x4_t b,float32x4_t v)103*67e74705SXin Li float32x4_t test_vmlaq_laneq_f32_0(float32x4_t a, float32x4_t b, float32x4_t v) {
104*67e74705SXin Li   return vmlaq_laneq_f32(a, b, v, 0);
105*67e74705SXin Li }
106*67e74705SXin Li 
107*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmls_lane_f32_0(<2 x float> %a, <2 x float> %b, <2 x float> %v) #0 {
108*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <2 x i32> zeroinitializer
109*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
110*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <2 x float> %a, [[MUL]]
111*67e74705SXin Li // CHECK:   ret <2 x float> [[SUB]]
test_vmls_lane_f32_0(float32x2_t a,float32x2_t b,float32x2_t v)112*67e74705SXin Li float32x2_t test_vmls_lane_f32_0(float32x2_t a, float32x2_t b, float32x2_t v) {
113*67e74705SXin Li   return vmls_lane_f32(a, b, v, 0);
114*67e74705SXin Li }
115*67e74705SXin Li 
116*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlsq_lane_f32_0(<4 x float> %a, <4 x float> %b, <2 x float> %v) #0 {
117*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <4 x i32> zeroinitializer
118*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
119*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <4 x float> %a, [[MUL]]
120*67e74705SXin Li // CHECK:   ret <4 x float> [[SUB]]
test_vmlsq_lane_f32_0(float32x4_t a,float32x4_t b,float32x2_t v)121*67e74705SXin Li float32x4_t test_vmlsq_lane_f32_0(float32x4_t a, float32x4_t b, float32x2_t v) {
122*67e74705SXin Li   return vmlsq_lane_f32(a, b, v, 0);
123*67e74705SXin Li }
124*67e74705SXin Li 
125*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmls_laneq_f32_0(<2 x float> %a, <2 x float> %b, <4 x float> %v) #0 {
126*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <2 x i32> zeroinitializer
127*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
128*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <2 x float> %a, [[MUL]]
129*67e74705SXin Li // CHECK:   ret <2 x float> [[SUB]]
test_vmls_laneq_f32_0(float32x2_t a,float32x2_t b,float32x4_t v)130*67e74705SXin Li float32x2_t test_vmls_laneq_f32_0(float32x2_t a, float32x2_t b, float32x4_t v) {
131*67e74705SXin Li   return vmls_laneq_f32(a, b, v, 0);
132*67e74705SXin Li }
133*67e74705SXin Li 
134*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlsq_laneq_f32_0(<4 x float> %a, <4 x float> %b, <4 x float> %v) #0 {
135*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <4 x i32> zeroinitializer
136*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
137*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <4 x float> %a, [[MUL]]
138*67e74705SXin Li // CHECK:   ret <4 x float> [[SUB]]
test_vmlsq_laneq_f32_0(float32x4_t a,float32x4_t b,float32x4_t v)139*67e74705SXin Li float32x4_t test_vmlsq_laneq_f32_0(float32x4_t a, float32x4_t b, float32x4_t v) {
140*67e74705SXin Li   return vmlsq_laneq_f32(a, b, v, 0);
141*67e74705SXin Li }
142*67e74705SXin Li 
143*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmla_lane_f32(<2 x float> %a, <2 x float> %b, <2 x float> %v) #0 {
144*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <2 x i32> <i32 1, i32 1>
145*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
146*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <2 x float> %a, [[MUL]]
147*67e74705SXin Li // CHECK:   ret <2 x float> [[ADD]]
test_vmla_lane_f32(float32x2_t a,float32x2_t b,float32x2_t v)148*67e74705SXin Li float32x2_t test_vmla_lane_f32(float32x2_t a, float32x2_t b, float32x2_t v) {
149*67e74705SXin Li   return vmla_lane_f32(a, b, v, 1);
150*67e74705SXin Li }
151*67e74705SXin Li 
152*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlaq_lane_f32(<4 x float> %a, <4 x float> %b, <2 x float> %v) #0 {
153*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
154*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
155*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <4 x float> %a, [[MUL]]
156*67e74705SXin Li // CHECK:   ret <4 x float> [[ADD]]
test_vmlaq_lane_f32(float32x4_t a,float32x4_t b,float32x2_t v)157*67e74705SXin Li float32x4_t test_vmlaq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) {
158*67e74705SXin Li   return vmlaq_lane_f32(a, b, v, 1);
159*67e74705SXin Li }
160*67e74705SXin Li 
161*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmla_laneq_f32(<2 x float> %a, <2 x float> %b, <4 x float> %v) #0 {
162*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <2 x i32> <i32 3, i32 3>
163*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
164*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <2 x float> %a, [[MUL]]
165*67e74705SXin Li // CHECK:   ret <2 x float> [[ADD]]
test_vmla_laneq_f32(float32x2_t a,float32x2_t b,float32x4_t v)166*67e74705SXin Li float32x2_t test_vmla_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t v) {
167*67e74705SXin Li   return vmla_laneq_f32(a, b, v, 3);
168*67e74705SXin Li }
169*67e74705SXin Li 
170*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlaq_laneq_f32(<4 x float> %a, <4 x float> %b, <4 x float> %v) #0 {
171*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
172*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
173*67e74705SXin Li // CHECK:   [[ADD:%.*]] = fadd <4 x float> %a, [[MUL]]
174*67e74705SXin Li // CHECK:   ret <4 x float> [[ADD]]
test_vmlaq_laneq_f32(float32x4_t a,float32x4_t b,float32x4_t v)175*67e74705SXin Li float32x4_t test_vmlaq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t v) {
176*67e74705SXin Li   return vmlaq_laneq_f32(a, b, v, 3);
177*67e74705SXin Li }
178*67e74705SXin Li 
179*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmls_lane_f32(<2 x float> %a, <2 x float> %b, <2 x float> %v) #0 {
180*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <2 x i32> <i32 1, i32 1>
181*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
182*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <2 x float> %a, [[MUL]]
183*67e74705SXin Li // CHECK:   ret <2 x float> [[SUB]]
test_vmls_lane_f32(float32x2_t a,float32x2_t b,float32x2_t v)184*67e74705SXin Li float32x2_t test_vmls_lane_f32(float32x2_t a, float32x2_t b, float32x2_t v) {
185*67e74705SXin Li   return vmls_lane_f32(a, b, v, 1);
186*67e74705SXin Li }
187*67e74705SXin Li 
188*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlsq_lane_f32(<4 x float> %a, <4 x float> %b, <2 x float> %v) #0 {
189*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <2 x float> %v, <2 x float> %v, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
190*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
191*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <4 x float> %a, [[MUL]]
192*67e74705SXin Li // CHECK:   ret <4 x float> [[SUB]]
test_vmlsq_lane_f32(float32x4_t a,float32x4_t b,float32x2_t v)193*67e74705SXin Li float32x4_t test_vmlsq_lane_f32(float32x4_t a, float32x4_t b, float32x2_t v) {
194*67e74705SXin Li   return vmlsq_lane_f32(a, b, v, 1);
195*67e74705SXin Li }
196*67e74705SXin Li // CHECK-LABEL: define <2 x float> @test_vmls_laneq_f32(<2 x float> %a, <2 x float> %b, <4 x float> %v) #0 {
197*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <2 x i32> <i32 3, i32 3>
198*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <2 x float> %b, [[SHUFFLE]]
199*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <2 x float> %a, [[MUL]]
200*67e74705SXin Li // CHECK:   ret <2 x float> [[SUB]]
test_vmls_laneq_f32(float32x2_t a,float32x2_t b,float32x4_t v)201*67e74705SXin Li float32x2_t test_vmls_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t v) {
202*67e74705SXin Li   return vmls_laneq_f32(a, b, v, 3);
203*67e74705SXin Li }
204*67e74705SXin Li 
205*67e74705SXin Li // CHECK-LABEL: define <4 x float> @test_vmlsq_laneq_f32(<4 x float> %a, <4 x float> %b, <4 x float> %v) #0 {
206*67e74705SXin Li // CHECK:   [[SHUFFLE:%.*]] = shufflevector <4 x float> %v, <4 x float> %v, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
207*67e74705SXin Li // CHECK:   [[MUL:%.*]] = fmul <4 x float> %b, [[SHUFFLE]]
208*67e74705SXin Li // CHECK:   [[SUB:%.*]] = fsub <4 x float> %a, [[MUL]]
209*67e74705SXin Li // CHECK:   ret <4 x float> [[SUB]]
test_vmlsq_laneq_f32(float32x4_t a,float32x4_t b,float32x4_t v)210*67e74705SXin Li float32x4_t test_vmlsq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t v) {
211*67e74705SXin Li   return vmlsq_laneq_f32(a, b, v, 3);
212*67e74705SXin Li }
213*67e74705SXin Li 
214*67e74705SXin Li // CHECK-LABEL: define <2 x double> @test_vfmaq_n_f64(<2 x double> %a, <2 x double> %b, double %c) #0 {
215*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %c, i32 0
216*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %c, i32 1
217*67e74705SXin Li // CHECK:   [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
218*67e74705SXin Li // CHECK:   [[TMP1:%.*]] = bitcast <2 x double> %b to <16 x i8>
219*67e74705SXin Li // CHECK:   [[TMP2:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <16 x i8>
220*67e74705SXin Li // CHECK:   [[TMP3:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
221*67e74705SXin Li // CHECK:   [[TMP4:%.*]] = bitcast <16 x i8> [[TMP1]] to <2 x double>
222*67e74705SXin Li // CHECK:   [[TMP5:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
223*67e74705SXin Li // CHECK:   [[TMP6:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[TMP4]], <2 x double> [[TMP5]], <2 x double> [[TMP3]]) #2
224*67e74705SXin Li // CHECK:   ret <2 x double> [[TMP6]]
test_vfmaq_n_f64(float64x2_t a,float64x2_t b,float64_t c)225*67e74705SXin Li float64x2_t test_vfmaq_n_f64(float64x2_t a, float64x2_t b, float64_t c) {
226*67e74705SXin Li   return vfmaq_n_f64(a, b, c);
227*67e74705SXin Li }
228*67e74705SXin Li 
229*67e74705SXin Li // CHECK-LABEL: define <2 x double> @test_vfmsq_n_f64(<2 x double> %a, <2 x double> %b, double %c) #0 {
230*67e74705SXin Li // CHECK:   [[SUB_I:%.*]] = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %b
231*67e74705SXin Li // CHECK:   [[VECINIT_I:%.*]] = insertelement <2 x double> undef, double %c, i32 0
232*67e74705SXin Li // CHECK:   [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double %c, i32 1
233*67e74705SXin Li // CHECK:   [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8>
234*67e74705SXin Li // CHECK:   [[TMP1:%.*]] = bitcast <2 x double> [[SUB_I]] to <16 x i8>
235*67e74705SXin Li // CHECK:   [[TMP2:%.*]] = bitcast <2 x double> [[VECINIT1_I]] to <16 x i8>
236*67e74705SXin Li // CHECK:   [[TMP3:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double>
237*67e74705SXin Li // CHECK:   [[TMP4:%.*]] = bitcast <16 x i8> [[TMP1]] to <2 x double>
238*67e74705SXin Li // CHECK:   [[TMP5:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
239*67e74705SXin Li // CHECK:   [[TMP6:%.*]] = call <2 x double> @llvm.fma.v2f64(<2 x double> [[TMP4]], <2 x double> [[TMP5]], <2 x double> [[TMP3]]) #2
240*67e74705SXin Li // CHECK:   ret <2 x double> [[TMP6]]
test_vfmsq_n_f64(float64x2_t a,float64x2_t b,float64_t c)241*67e74705SXin Li float64x2_t test_vfmsq_n_f64(float64x2_t a, float64x2_t b, float64_t c) {
242*67e74705SXin Li   return vfmsq_n_f64(a, b, c);
243*67e74705SXin Li }
244