xref: /llvm-project/clang/test/CodeGen/AArch64/neon-scalar-x-indexed-elem.c (revision 207e5ccceec8d3cc3f32723e78f2a142bc61b07d)
1*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -target-cpu cyclone \
2*207e5cccSFangrui Song // RUN: -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s
3*207e5cccSFangrui Song 
4*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target || arm-registered-target
5*207e5cccSFangrui Song 
6*207e5cccSFangrui Song #include <arm_neon.h>
7*207e5cccSFangrui Song 
8*207e5cccSFangrui Song 
9*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} float @test_vmuls_lane_f32(float noundef %a, <2 x float> noundef %b) #0 {
10*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <2 x float> %b, i32 1
11*207e5cccSFangrui Song // CHECK:   [[MUL:%.*]] = fmul float %a, [[VGET_LANE]]
12*207e5cccSFangrui Song // CHECK:   ret float [[MUL]]
13*207e5cccSFangrui Song float32_t test_vmuls_lane_f32(float32_t a, float32x2_t b) {
14*207e5cccSFangrui Song   return vmuls_lane_f32(a, b, 1);
15*207e5cccSFangrui Song }
16*207e5cccSFangrui Song 
17*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} double @test_vmuld_lane_f64(double noundef %a, <1 x double> noundef %b) #0 {
18*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> %b, i32 0
19*207e5cccSFangrui Song // CHECK:   [[MUL:%.*]] = fmul double %a, [[VGET_LANE]]
20*207e5cccSFangrui Song // CHECK:   ret double [[MUL]]
21*207e5cccSFangrui Song float64_t test_vmuld_lane_f64(float64_t a, float64x1_t b) {
22*207e5cccSFangrui Song   return vmuld_lane_f64(a, b, 0);
23*207e5cccSFangrui Song }
24*207e5cccSFangrui Song 
25*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} float @test_vmuls_laneq_f32(float noundef %a, <4 x float> noundef %b) #0 {
26*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <4 x float> %b, i32 3
27*207e5cccSFangrui Song // CHECK:   [[MUL:%.*]] = fmul float %a, [[VGETQ_LANE]]
28*207e5cccSFangrui Song // CHECK:   ret float [[MUL]]
29*207e5cccSFangrui Song float32_t test_vmuls_laneq_f32(float32_t a, float32x4_t b) {
30*207e5cccSFangrui Song   return vmuls_laneq_f32(a, b, 3);
31*207e5cccSFangrui Song }
32*207e5cccSFangrui Song 
33*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} double @test_vmuld_laneq_f64(double noundef %a, <2 x double> noundef %b) #0 {
34*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1
35*207e5cccSFangrui Song // CHECK:   [[MUL:%.*]] = fmul double %a, [[VGETQ_LANE]]
36*207e5cccSFangrui Song // CHECK:   ret double [[MUL]]
37*207e5cccSFangrui Song float64_t test_vmuld_laneq_f64(float64_t a, float64x2_t b) {
38*207e5cccSFangrui Song   return vmuld_laneq_f64(a, b, 1);
39*207e5cccSFangrui Song }
40*207e5cccSFangrui Song 
41*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vmul_n_f64(<1 x double> noundef %a, double noundef %b) #0 {
42*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = bitcast <1 x double> %a to double
43*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = fmul double [[TMP2]], %b
44*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = bitcast double [[TMP3]] to <1 x double>
45*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[TMP4]]
46*207e5cccSFangrui Song float64x1_t test_vmul_n_f64(float64x1_t a, float64_t b) {
47*207e5cccSFangrui Song   return vmul_n_f64(a, b);
48*207e5cccSFangrui Song }
49*207e5cccSFangrui Song 
50*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} float @test_vmulxs_lane_f32(float noundef %a, <2 x float> noundef %b) #0 {
51*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <2 x float> %b, i32 1
52*207e5cccSFangrui Song // CHECK:   [[VMULXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmulx.f32(float %a, float [[VGET_LANE]])
53*207e5cccSFangrui Song // CHECK:   ret float [[VMULXS_F32_I]]
54*207e5cccSFangrui Song float32_t test_vmulxs_lane_f32(float32_t a, float32x2_t b) {
55*207e5cccSFangrui Song   return vmulxs_lane_f32(a, b, 1);
56*207e5cccSFangrui Song }
57*207e5cccSFangrui Song 
58*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} float @test_vmulxs_laneq_f32(float noundef %a, <4 x float> noundef %b) #0 {
59*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <4 x float> %b, i32 3
60*207e5cccSFangrui Song // CHECK:   [[VMULXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmulx.f32(float %a, float [[VGETQ_LANE]])
61*207e5cccSFangrui Song // CHECK:   ret float [[VMULXS_F32_I]]
62*207e5cccSFangrui Song float32_t test_vmulxs_laneq_f32(float32_t a, float32x4_t b) {
63*207e5cccSFangrui Song   return vmulxs_laneq_f32(a, b, 3);
64*207e5cccSFangrui Song }
65*207e5cccSFangrui Song 
66*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} double @test_vmulxd_lane_f64(double noundef %a, <1 x double> noundef %b) #0 {
67*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> %b, i32 0
68*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double %a, double [[VGET_LANE]])
69*207e5cccSFangrui Song // CHECK:   ret double [[VMULXD_F64_I]]
70*207e5cccSFangrui Song float64_t test_vmulxd_lane_f64(float64_t a, float64x1_t b) {
71*207e5cccSFangrui Song   return vmulxd_lane_f64(a, b, 0);
72*207e5cccSFangrui Song }
73*207e5cccSFangrui Song 
74*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} double @test_vmulxd_laneq_f64(double noundef %a, <2 x double> noundef %b) #0 {
75*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1
76*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double %a, double [[VGETQ_LANE]])
77*207e5cccSFangrui Song // CHECK:   ret double [[VMULXD_F64_I]]
78*207e5cccSFangrui Song float64_t test_vmulxd_laneq_f64(float64_t a, float64x2_t b) {
79*207e5cccSFangrui Song   return vmulxd_laneq_f64(a, b, 1);
80*207e5cccSFangrui Song }
81*207e5cccSFangrui Song 
82*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vmulx_lane_f64(<1 x double> noundef %a, <1 x double> noundef %b) #0 {
83*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0
84*207e5cccSFangrui Song // CHECK:   [[VGET_LANE6:%.*]] = extractelement <1 x double> %b, i32 0
85*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGET_LANE6]])
86*207e5cccSFangrui Song // CHECK:   [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0
87*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[VSET_LANE]]
88*207e5cccSFangrui Song float64x1_t test_vmulx_lane_f64(float64x1_t a, float64x1_t b) {
89*207e5cccSFangrui Song   return vmulx_lane_f64(a, b, 0);
90*207e5cccSFangrui Song }
91*207e5cccSFangrui Song 
92*207e5cccSFangrui Song 
93*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vmulx_laneq_f64_0(<1 x double> noundef %a, <2 x double> noundef %b) #0 {
94*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0
95*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 0
96*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]])
97*207e5cccSFangrui Song // CHECK:   [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0
98*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[VSET_LANE]]
99*207e5cccSFangrui Song float64x1_t test_vmulx_laneq_f64_0(float64x1_t a, float64x2_t b) {
100*207e5cccSFangrui Song   return vmulx_laneq_f64(a, b, 0);
101*207e5cccSFangrui Song }
102*207e5cccSFangrui Song 
103*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vmulx_laneq_f64_1(<1 x double> noundef %a, <2 x double> noundef %b) #0 {
104*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0
105*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1
106*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]])
107*207e5cccSFangrui Song // CHECK:   [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0
108*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[VSET_LANE]]
109*207e5cccSFangrui Song float64x1_t test_vmulx_laneq_f64_1(float64x1_t a, float64x2_t b) {
110*207e5cccSFangrui Song   return vmulx_laneq_f64(a, b, 1);
111*207e5cccSFangrui Song }
112*207e5cccSFangrui Song 
113*207e5cccSFangrui Song 
114*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} float @test_vfmas_lane_f32(float noundef %a, float noundef %b, <2 x float> noundef %c) #0 {
115*207e5cccSFangrui Song // CHECK:   [[EXTRACT:%.*]] = extractelement <2 x float> %c, i32 1
116*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = call float @llvm.fma.f32(float %b, float [[EXTRACT]], float %a)
117*207e5cccSFangrui Song // CHECK:   ret float [[TMP2]]
118*207e5cccSFangrui Song float32_t test_vfmas_lane_f32(float32_t a, float32_t b, float32x2_t c) {
119*207e5cccSFangrui Song   return vfmas_lane_f32(a, b, c, 1);
120*207e5cccSFangrui Song }
121*207e5cccSFangrui Song 
122*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} double @test_vfmad_lane_f64(double noundef %a, double noundef %b, <1 x double> noundef %c) #0 {
123*207e5cccSFangrui Song // CHECK:   [[EXTRACT:%.*]] = extractelement <1 x double> %c, i32 0
124*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = call double @llvm.fma.f64(double %b, double [[EXTRACT]], double %a)
125*207e5cccSFangrui Song // CHECK:   ret double [[TMP2]]
126*207e5cccSFangrui Song float64_t test_vfmad_lane_f64(float64_t a, float64_t b, float64x1_t c) {
127*207e5cccSFangrui Song   return vfmad_lane_f64(a, b, c, 0);
128*207e5cccSFangrui Song }
129*207e5cccSFangrui Song 
130*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} double @test_vfmad_laneq_f64(double noundef %a, double noundef %b, <2 x double> noundef %c) #0 {
131*207e5cccSFangrui Song // CHECK:   [[EXTRACT:%.*]] = extractelement <2 x double> %c, i32 1
132*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = call double @llvm.fma.f64(double %b, double [[EXTRACT]], double %a)
133*207e5cccSFangrui Song // CHECK:   ret double [[TMP2]]
134*207e5cccSFangrui Song float64_t test_vfmad_laneq_f64(float64_t a, float64_t b, float64x2_t c) {
135*207e5cccSFangrui Song   return vfmad_laneq_f64(a, b, c, 1);
136*207e5cccSFangrui Song }
137*207e5cccSFangrui Song 
138*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} float @test_vfmss_lane_f32(float noundef %a, float noundef %b, <2 x float> noundef %c) #0 {
139*207e5cccSFangrui Song // CHECK:   [[SUB:%.*]] = fneg float %b
140*207e5cccSFangrui Song // CHECK:   [[EXTRACT:%.*]] = extractelement <2 x float> %c, i32 1
141*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = call float @llvm.fma.f32(float [[SUB]], float [[EXTRACT]], float %a)
142*207e5cccSFangrui Song // CHECK:   ret float [[TMP2]]
143*207e5cccSFangrui Song float32_t test_vfmss_lane_f32(float32_t a, float32_t b, float32x2_t c) {
144*207e5cccSFangrui Song   return vfmss_lane_f32(a, b, c, 1);
145*207e5cccSFangrui Song }
146*207e5cccSFangrui Song 
147*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vfma_lane_f64(<1 x double> noundef %a, <1 x double> noundef %b, <1 x double> noundef %v) #0 {
148*207e5cccSFangrui Song // CHECK:   [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
149*207e5cccSFangrui Song // CHECK:   [[TMP1:%.*]] = bitcast <1 x double> %b to <8 x i8>
150*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = bitcast <1 x double> %v to <8 x i8>
151*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double>
152*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = shufflevector <1 x double> [[TMP3]], <1 x double> [[TMP3]], <1 x i32> zeroinitializer
153*207e5cccSFangrui Song // CHECK:   [[FMLA:%.*]] = bitcast <8 x i8> [[TMP1]] to <1 x double>
154*207e5cccSFangrui Song // CHECK:   [[FMLA1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
155*207e5cccSFangrui Song // CHECK:   [[FMLA2:%.*]] = call <1 x double> @llvm.fma.v1f64(<1 x double> [[FMLA]], <1 x double> [[LANE]], <1 x double> [[FMLA1]])
156*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[FMLA2]]
157*207e5cccSFangrui Song float64x1_t test_vfma_lane_f64(float64x1_t a, float64x1_t b, float64x1_t v) {
158*207e5cccSFangrui Song   return vfma_lane_f64(a, b, v, 0);
159*207e5cccSFangrui Song }
160*207e5cccSFangrui Song 
161*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vfms_lane_f64(<1 x double> noundef %a, <1 x double> noundef %b, <1 x double> noundef %v) #0 {
162*207e5cccSFangrui Song // CHECK:   [[SUB:%.*]] = fneg <1 x double> %b
163*207e5cccSFangrui Song // CHECK:   [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
164*207e5cccSFangrui Song // CHECK:   [[TMP1:%.*]] = bitcast <1 x double> [[SUB]] to <8 x i8>
165*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = bitcast <1 x double> %v to <8 x i8>
166*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double>
167*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = shufflevector <1 x double> [[TMP3]], <1 x double> [[TMP3]], <1 x i32> zeroinitializer
168*207e5cccSFangrui Song // CHECK:   [[FMLA:%.*]] = bitcast <8 x i8> [[TMP1]] to <1 x double>
169*207e5cccSFangrui Song // CHECK:   [[FMLA1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double>
170*207e5cccSFangrui Song // CHECK:   [[FMLA2:%.*]] = call <1 x double> @llvm.fma.v1f64(<1 x double> [[FMLA]], <1 x double> [[LANE]], <1 x double> [[FMLA1]])
171*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[FMLA2]]
172*207e5cccSFangrui Song float64x1_t test_vfms_lane_f64(float64x1_t a, float64x1_t b, float64x1_t v) {
173*207e5cccSFangrui Song   return vfms_lane_f64(a, b, v, 0);
174*207e5cccSFangrui Song }
175*207e5cccSFangrui Song 
176*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vfma_laneq_f64(<1 x double> noundef %a, <1 x double> noundef %b, <2 x double> noundef %v) #0 {
177*207e5cccSFangrui Song // CHECK:   [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
178*207e5cccSFangrui Song // CHECK:   [[TMP1:%.*]] = bitcast <1 x double> %b to <8 x i8>
179*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = bitcast <2 x double> %v to <16 x i8>
180*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = bitcast <8 x i8> [[TMP0]] to double
181*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = bitcast <8 x i8> [[TMP1]] to double
182*207e5cccSFangrui Song // CHECK:   [[TMP5:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
183*207e5cccSFangrui Song // CHECK:   [[EXTRACT:%.*]] = extractelement <2 x double> [[TMP5]], i32 0
184*207e5cccSFangrui Song // CHECK:   [[TMP6:%.*]] = call double @llvm.fma.f64(double [[TMP4]], double [[EXTRACT]], double [[TMP3]])
185*207e5cccSFangrui Song // CHECK:   [[TMP7:%.*]] = bitcast double [[TMP6]] to <1 x double>
186*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[TMP7]]
187*207e5cccSFangrui Song float64x1_t test_vfma_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) {
188*207e5cccSFangrui Song   return vfma_laneq_f64(a, b, v, 0);
189*207e5cccSFangrui Song }
190*207e5cccSFangrui Song 
191*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vfms_laneq_f64(<1 x double> noundef %a, <1 x double> noundef %b, <2 x double> noundef %v) #0 {
192*207e5cccSFangrui Song // CHECK:   [[SUB:%.*]] = fneg <1 x double> %b
193*207e5cccSFangrui Song // CHECK:   [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8>
194*207e5cccSFangrui Song // CHECK:   [[TMP1:%.*]] = bitcast <1 x double> [[SUB]] to <8 x i8>
195*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = bitcast <2 x double> %v to <16 x i8>
196*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = bitcast <8 x i8> [[TMP0]] to double
197*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = bitcast <8 x i8> [[TMP1]] to double
198*207e5cccSFangrui Song // CHECK:   [[TMP5:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double>
199*207e5cccSFangrui Song // CHECK:   [[EXTRACT:%.*]] = extractelement <2 x double> [[TMP5]], i32 0
200*207e5cccSFangrui Song // CHECK:   [[TMP6:%.*]] = call double @llvm.fma.f64(double [[TMP4]], double [[EXTRACT]], double [[TMP3]])
201*207e5cccSFangrui Song // CHECK:   [[TMP7:%.*]] = bitcast double [[TMP6]] to <1 x double>
202*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[TMP7]]
203*207e5cccSFangrui Song float64x1_t test_vfms_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) {
204*207e5cccSFangrui Song   return vfms_laneq_f64(a, b, v, 0);
205*207e5cccSFangrui Song }
206*207e5cccSFangrui Song 
207*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmullh_lane_s16(i16 noundef %a, <4 x i16> noundef %b) #0 {
208*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3
209*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %a, i64 0
210*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[VGET_LANE]], i64 0
211*207e5cccSFangrui Song // CHECK:   [[VQDMULLH_S16_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
212*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = extractelement <4 x i32> [[VQDMULLH_S16_I]], i64 0
213*207e5cccSFangrui Song // CHECK:   ret i32 [[TMP4]]
214*207e5cccSFangrui Song int32_t test_vqdmullh_lane_s16(int16_t a, int16x4_t b) {
215*207e5cccSFangrui Song   return vqdmullh_lane_s16(a, b, 3);
216*207e5cccSFangrui Song }
217*207e5cccSFangrui Song 
218*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i64 @test_vqdmulls_lane_s32(i32 noundef %a, <2 x i32> noundef %b) #0 {
219*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1
220*207e5cccSFangrui Song // CHECK:   [[VQDMULLS_S32_I:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 [[VGET_LANE]])
221*207e5cccSFangrui Song // CHECK:   ret i64 [[VQDMULLS_S32_I]]
222*207e5cccSFangrui Song int64_t test_vqdmulls_lane_s32(int32_t a, int32x2_t b) {
223*207e5cccSFangrui Song   return vqdmulls_lane_s32(a, b, 1);
224*207e5cccSFangrui Song }
225*207e5cccSFangrui Song 
226*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmullh_laneq_s16(i16 noundef %a, <8 x i16> noundef %b) #0 {
227*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7
228*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %a, i64 0
229*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[VGETQ_LANE]], i64 0
230*207e5cccSFangrui Song // CHECK:   [[VQDMULLH_S16_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
231*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = extractelement <4 x i32> [[VQDMULLH_S16_I]], i64 0
232*207e5cccSFangrui Song // CHECK:   ret i32 [[TMP4]]
233*207e5cccSFangrui Song int32_t test_vqdmullh_laneq_s16(int16_t a, int16x8_t b) {
234*207e5cccSFangrui Song   return vqdmullh_laneq_s16(a, b, 7);
235*207e5cccSFangrui Song }
236*207e5cccSFangrui Song 
237*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i64 @test_vqdmulls_laneq_s32(i32 noundef %a, <4 x i32> noundef %b) #0 {
238*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3
239*207e5cccSFangrui Song // CHECK:   [[VQDMULLS_S32_I:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 [[VGETQ_LANE]])
240*207e5cccSFangrui Song // CHECK:   ret i64 [[VQDMULLS_S32_I]]
241*207e5cccSFangrui Song int64_t test_vqdmulls_laneq_s32(int32_t a, int32x4_t b) {
242*207e5cccSFangrui Song   return vqdmulls_laneq_s32(a, b, 3);
243*207e5cccSFangrui Song }
244*207e5cccSFangrui Song 
245*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i16 @test_vqdmulhh_lane_s16(i16 noundef %a, <4 x i16> noundef %b) #0 {
246*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3
247*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %a, i64 0
248*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[VGET_LANE]], i64 0
249*207e5cccSFangrui Song // CHECK:   [[VQDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
250*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = extractelement <4 x i16> [[VQDMULHH_S16_I]], i64 0
251*207e5cccSFangrui Song // CHECK:   ret i16 [[TMP4]]
252*207e5cccSFangrui Song int16_t test_vqdmulhh_lane_s16(int16_t a, int16x4_t b) {
253*207e5cccSFangrui Song   return vqdmulhh_lane_s16(a, b, 3);
254*207e5cccSFangrui Song }
255*207e5cccSFangrui Song 
256*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmulhs_lane_s32(i32 noundef %a, <2 x i32> noundef %b) #0 {
257*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1
258*207e5cccSFangrui Song // CHECK:   [[VQDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqdmulh.i32(i32 %a, i32 [[VGET_LANE]])
259*207e5cccSFangrui Song // CHECK:   ret i32 [[VQDMULHS_S32_I]]
260*207e5cccSFangrui Song int32_t test_vqdmulhs_lane_s32(int32_t a, int32x2_t b) {
261*207e5cccSFangrui Song   return vqdmulhs_lane_s32(a, b, 1);
262*207e5cccSFangrui Song }
263*207e5cccSFangrui Song 
264*207e5cccSFangrui Song 
265*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i16 @test_vqdmulhh_laneq_s16(i16 noundef %a, <8 x i16> noundef %b) #0 {
266*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7
267*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %a, i64 0
268*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[VGETQ_LANE]], i64 0
269*207e5cccSFangrui Song // CHECK:   [[VQDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
270*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = extractelement <4 x i16> [[VQDMULHH_S16_I]], i64 0
271*207e5cccSFangrui Song // CHECK:   ret i16 [[TMP4]]
272*207e5cccSFangrui Song int16_t test_vqdmulhh_laneq_s16(int16_t a, int16x8_t b) {
273*207e5cccSFangrui Song   return vqdmulhh_laneq_s16(a, b, 7);
274*207e5cccSFangrui Song }
275*207e5cccSFangrui Song 
276*207e5cccSFangrui Song 
277*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmulhs_laneq_s32(i32 noundef %a, <4 x i32> noundef %b) #0 {
278*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3
279*207e5cccSFangrui Song // CHECK:   [[VQDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqdmulh.i32(i32 %a, i32 [[VGETQ_LANE]])
280*207e5cccSFangrui Song // CHECK:   ret i32 [[VQDMULHS_S32_I]]
281*207e5cccSFangrui Song int32_t test_vqdmulhs_laneq_s32(int32_t a, int32x4_t b) {
282*207e5cccSFangrui Song   return vqdmulhs_laneq_s32(a, b, 3);
283*207e5cccSFangrui Song }
284*207e5cccSFangrui Song 
285*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i16 @test_vqrdmulhh_lane_s16(i16 noundef %a, <4 x i16> noundef %b) #0 {
286*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3
287*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %a, i64 0
288*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[VGET_LANE]], i64 0
289*207e5cccSFangrui Song // CHECK:   [[VQRDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
290*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = extractelement <4 x i16> [[VQRDMULHH_S16_I]], i64 0
291*207e5cccSFangrui Song // CHECK:   ret i16 [[TMP4]]
292*207e5cccSFangrui Song int16_t test_vqrdmulhh_lane_s16(int16_t a, int16x4_t b) {
293*207e5cccSFangrui Song   return vqrdmulhh_lane_s16(a, b, 3);
294*207e5cccSFangrui Song }
295*207e5cccSFangrui Song 
296*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqrdmulhs_lane_s32(i32 noundef %a, <2 x i32> noundef %b) #0 {
297*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1
298*207e5cccSFangrui Song // CHECK:   [[VQRDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqrdmulh.i32(i32 %a, i32 [[VGET_LANE]])
299*207e5cccSFangrui Song // CHECK:   ret i32 [[VQRDMULHS_S32_I]]
300*207e5cccSFangrui Song int32_t test_vqrdmulhs_lane_s32(int32_t a, int32x2_t b) {
301*207e5cccSFangrui Song   return vqrdmulhs_lane_s32(a, b, 1);
302*207e5cccSFangrui Song }
303*207e5cccSFangrui Song 
304*207e5cccSFangrui Song 
305*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i16 @test_vqrdmulhh_laneq_s16(i16 noundef %a, <8 x i16> noundef %b) #0 {
306*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7
307*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %a, i64 0
308*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[VGETQ_LANE]], i64 0
309*207e5cccSFangrui Song // CHECK:   [[VQRDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
310*207e5cccSFangrui Song // CHECK:   [[TMP4:%.*]] = extractelement <4 x i16> [[VQRDMULHH_S16_I]], i64 0
311*207e5cccSFangrui Song // CHECK:   ret i16 [[TMP4]]
312*207e5cccSFangrui Song int16_t test_vqrdmulhh_laneq_s16(int16_t a, int16x8_t b) {
313*207e5cccSFangrui Song   return vqrdmulhh_laneq_s16(a, b, 7);
314*207e5cccSFangrui Song }
315*207e5cccSFangrui Song 
316*207e5cccSFangrui Song 
317*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqrdmulhs_laneq_s32(i32 noundef %a, <4 x i32> noundef %b) #0 {
318*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3
319*207e5cccSFangrui Song // CHECK:   [[VQRDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqrdmulh.i32(i32 %a, i32 [[VGETQ_LANE]])
320*207e5cccSFangrui Song // CHECK:   ret i32 [[VQRDMULHS_S32_I]]
321*207e5cccSFangrui Song int32_t test_vqrdmulhs_laneq_s32(int32_t a, int32x4_t b) {
322*207e5cccSFangrui Song   return vqrdmulhs_laneq_s32(a, b, 3);
323*207e5cccSFangrui Song }
324*207e5cccSFangrui Song 
325*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmlalh_lane_s16(i32 noundef %a, i16 noundef %b, <4 x i16> noundef %c) #0 {
326*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <4 x i16> %c, i32 3
327*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %b, i64 0
328*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[LANE]], i64 0
329*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
330*207e5cccSFangrui Song // CHECK:   [[LANE0:%.*]] = extractelement <4 x i32> [[VQDMLXL]], i64 0
331*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i32 @llvm.aarch64.neon.sqadd.i32(i32 %a, i32 [[LANE0]])
332*207e5cccSFangrui Song // CHECK:   ret i32 [[VQDMLXL1]]
333*207e5cccSFangrui Song int32_t test_vqdmlalh_lane_s16(int32_t a, int16_t b, int16x4_t c) {
334*207e5cccSFangrui Song   return vqdmlalh_lane_s16(a, b, c, 3);
335*207e5cccSFangrui Song }
336*207e5cccSFangrui Song 
337*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i64 @test_vqdmlals_lane_s32(i64 noundef %a, i32 noundef %b, <2 x i32> noundef %c) #0 {
338*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <2 x i32> %c, i32 1
339*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
340*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqadd.i64(i64 %a, i64 [[VQDMLXL]])
341*207e5cccSFangrui Song // CHECK:   ret i64 [[VQDMLXL1]]
342*207e5cccSFangrui Song int64_t test_vqdmlals_lane_s32(int64_t a, int32_t b, int32x2_t c) {
343*207e5cccSFangrui Song   return vqdmlals_lane_s32(a, b, c, 1);
344*207e5cccSFangrui Song }
345*207e5cccSFangrui Song 
346*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmlalh_laneq_s16(i32 noundef %a, i16 noundef %b, <8 x i16> noundef %c) #0 {
347*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <8 x i16> %c, i32 7
348*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %b, i64 0
349*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[LANE]], i64 0
350*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
351*207e5cccSFangrui Song // CHECK:   [[LANE0:%.*]] = extractelement <4 x i32> [[VQDMLXL]], i64 0
352*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i32 @llvm.aarch64.neon.sqadd.i32(i32 %a, i32 [[LANE0]])
353*207e5cccSFangrui Song // CHECK:   ret i32 [[VQDMLXL1]]
354*207e5cccSFangrui Song int32_t test_vqdmlalh_laneq_s16(int32_t a, int16_t b, int16x8_t c) {
355*207e5cccSFangrui Song   return vqdmlalh_laneq_s16(a, b, c, 7);
356*207e5cccSFangrui Song }
357*207e5cccSFangrui Song 
358*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i64 @test_vqdmlals_laneq_s32(i64 noundef %a, i32 noundef %b, <4 x i32> noundef %c) #0 {
359*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <4 x i32> %c, i32 3
360*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
361*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqadd.i64(i64 %a, i64 [[VQDMLXL]])
362*207e5cccSFangrui Song // CHECK:   ret i64 [[VQDMLXL1]]
363*207e5cccSFangrui Song int64_t test_vqdmlals_laneq_s32(int64_t a, int32_t b, int32x4_t c) {
364*207e5cccSFangrui Song   return vqdmlals_laneq_s32(a, b, c, 3);
365*207e5cccSFangrui Song }
366*207e5cccSFangrui Song 
367*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmlslh_lane_s16(i32 noundef %a, i16 noundef %b, <4 x i16> noundef %c) #0 {
368*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <4 x i16> %c, i32 3
369*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %b, i64 0
370*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[LANE]], i64 0
371*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
372*207e5cccSFangrui Song // CHECK:   [[LANE0:%.*]] = extractelement <4 x i32> [[VQDMLXL]], i64 0
373*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i32 @llvm.aarch64.neon.sqsub.i32(i32 %a, i32 [[LANE0]])
374*207e5cccSFangrui Song // CHECK:   ret i32 [[VQDMLXL1]]
375*207e5cccSFangrui Song int32_t test_vqdmlslh_lane_s16(int32_t a, int16_t b, int16x4_t c) {
376*207e5cccSFangrui Song   return vqdmlslh_lane_s16(a, b, c, 3);
377*207e5cccSFangrui Song }
378*207e5cccSFangrui Song 
379*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i64 @test_vqdmlsls_lane_s32(i64 noundef %a, i32 noundef %b, <2 x i32> noundef %c) #0 {
380*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <2 x i32> %c, i32 1
381*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
382*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqsub.i64(i64 %a, i64 [[VQDMLXL]])
383*207e5cccSFangrui Song // CHECK:   ret i64 [[VQDMLXL1]]
384*207e5cccSFangrui Song int64_t test_vqdmlsls_lane_s32(int64_t a, int32_t b, int32x2_t c) {
385*207e5cccSFangrui Song   return vqdmlsls_lane_s32(a, b, c, 1);
386*207e5cccSFangrui Song }
387*207e5cccSFangrui Song 
388*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i32 @test_vqdmlslh_laneq_s16(i32 noundef %a, i16 noundef %b, <8 x i16> noundef %c) #0 {
389*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <8 x i16> %c, i32 7
390*207e5cccSFangrui Song // CHECK:   [[TMP2:%.*]] = insertelement <4 x i16> poison, i16 %b, i64 0
391*207e5cccSFangrui Song // CHECK:   [[TMP3:%.*]] = insertelement <4 x i16> poison, i16 [[LANE]], i64 0
392*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]])
393*207e5cccSFangrui Song // CHECK:   [[LANE0:%.*]] = extractelement <4 x i32> [[VQDMLXL]], i64 0
394*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i32 @llvm.aarch64.neon.sqsub.i32(i32 %a, i32 [[LANE0]])
395*207e5cccSFangrui Song // CHECK:   ret i32 [[VQDMLXL1]]
396*207e5cccSFangrui Song int32_t test_vqdmlslh_laneq_s16(int32_t a, int16_t b, int16x8_t c) {
397*207e5cccSFangrui Song   return vqdmlslh_laneq_s16(a, b, c, 7);
398*207e5cccSFangrui Song }
399*207e5cccSFangrui Song 
400*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} i64 @test_vqdmlsls_laneq_s32(i64 noundef %a, i32 noundef %b, <4 x i32> noundef %c) #0 {
401*207e5cccSFangrui Song // CHECK:   [[LANE:%.*]] = extractelement <4 x i32> %c, i32 3
402*207e5cccSFangrui Song // CHECK:   [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]])
403*207e5cccSFangrui Song // CHECK:   [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqsub.i64(i64 %a, i64 [[VQDMLXL]])
404*207e5cccSFangrui Song // CHECK:   ret i64 [[VQDMLXL1]]
405*207e5cccSFangrui Song int64_t test_vqdmlsls_laneq_s32(int64_t a, int32_t b, int32x4_t c) {
406*207e5cccSFangrui Song   return vqdmlsls_laneq_s32(a, b, c, 3);
407*207e5cccSFangrui Song }
408*207e5cccSFangrui Song 
409*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vmulx_lane_f64_0() #0 {
410*207e5cccSFangrui Song // CHECK:   [[TMP0:%.*]] = bitcast i64 4599917171378402754 to <1 x double>
411*207e5cccSFangrui Song // CHECK:   [[TMP1:%.*]] = bitcast i64 4606655882138939123 to <1 x double>
412*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP0]], i32 0
413*207e5cccSFangrui Song // CHECK:   [[VGET_LANE7:%.*]] = extractelement <1 x double> [[TMP1]], i32 0
414*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGET_LANE7]])
415*207e5cccSFangrui Song // CHECK:   [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP0]], double [[VMULXD_F64_I]], i32 0
416*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[VSET_LANE]]
417*207e5cccSFangrui Song float64x1_t test_vmulx_lane_f64_0() {
418*207e5cccSFangrui Song       float64x1_t arg1;
419*207e5cccSFangrui Song       float64x1_t arg2;
420*207e5cccSFangrui Song       float64x1_t result;
421*207e5cccSFangrui Song       float64_t sarg1, sarg2, sres;
422*207e5cccSFangrui Song       arg1 = vcreate_f64(UINT64_C(0x3fd6304bc43ab5c2));
423*207e5cccSFangrui Song       arg2 = vcreate_f64(UINT64_C(0x3fee211e215aeef3));
424*207e5cccSFangrui Song       result = vmulx_lane_f64(arg1, arg2, 0);
425*207e5cccSFangrui Song       return result;
426*207e5cccSFangrui Song }
427*207e5cccSFangrui Song 
428*207e5cccSFangrui Song // CHECK-LABEL: define{{.*}} <1 x double> @test_vmulx_laneq_f64_2() #0 {
429*207e5cccSFangrui Song // CHECK:   [[TMP0:%.*]] = bitcast i64 4599917171378402754 to <1 x double>
430*207e5cccSFangrui Song // CHECK:   [[TMP1:%.*]] = bitcast i64 4606655882138939123 to <1 x double>
431*207e5cccSFangrui Song // CHECK:   [[SHUFFLE_I:%.*]] = shufflevector <1 x double> [[TMP0]], <1 x double> [[TMP1]], <2 x i32> <i32 0, i32 1>
432*207e5cccSFangrui Song // CHECK:   [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP0]], i32 0
433*207e5cccSFangrui Song // CHECK:   [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[SHUFFLE_I]], i32 1
434*207e5cccSFangrui Song // CHECK:   [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]])
435*207e5cccSFangrui Song // CHECK:   [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP0]], double [[VMULXD_F64_I]], i32 0
436*207e5cccSFangrui Song // CHECK:   ret <1 x double> [[VSET_LANE]]
437*207e5cccSFangrui Song float64x1_t test_vmulx_laneq_f64_2() {
438*207e5cccSFangrui Song       float64x1_t arg1;
439*207e5cccSFangrui Song       float64x1_t arg2;
440*207e5cccSFangrui Song       float64x2_t arg3;
441*207e5cccSFangrui Song       float64x1_t result;
442*207e5cccSFangrui Song       float64_t sarg1, sarg2, sres;
443*207e5cccSFangrui Song       arg1 = vcreate_f64(UINT64_C(0x3fd6304bc43ab5c2));
444*207e5cccSFangrui Song       arg2 = vcreate_f64(UINT64_C(0x3fee211e215aeef3));
445*207e5cccSFangrui Song       arg3 = vcombine_f64(arg1, arg2);
446*207e5cccSFangrui Song       result = vmulx_laneq_f64(arg1, arg3, 1);
447*207e5cccSFangrui Song       return result;
448*207e5cccSFangrui Song }
449