xref: /llvm-project/clang/test/CodeGen/AArch64/v8.2a-neon-intrinsics-generic.c (revision 207e5ccceec8d3cc3f32723e78f2a142bc61b07d)
1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature
2*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -target-feature -fullfp16 -target-feature +v8a\
3*207e5cccSFangrui Song // RUN: -flax-vector-conversions=none -disable-O0-optnone -emit-llvm -o - %s \
4*207e5cccSFangrui Song // RUN: | opt -S -passes=mem2reg \
5*207e5cccSFangrui Song // RUN: | FileCheck %s
6*207e5cccSFangrui Song // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -target-feature +fullfp16 -target-feature +v8.2a\
7*207e5cccSFangrui Song // RUN: -flax-vector-conversions=none -disable-O0-optnone -emit-llvm -o - %s \
8*207e5cccSFangrui Song // RUN: | opt -S -passes=mem2reg \
9*207e5cccSFangrui Song // RUN: | FileCheck %s
10*207e5cccSFangrui Song 
11*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target
12*207e5cccSFangrui Song 
13*207e5cccSFangrui Song #include <arm_neon.h>
14*207e5cccSFangrui Song 
15*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vbsl_f16
16*207e5cccSFangrui Song // CHECK-SAME: (<4 x i16> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]], <4 x half> noundef [[C:%.*]]) #[[ATTR0:[0-9]+]] {
17*207e5cccSFangrui Song // CHECK-NEXT:  entry:
18*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x i16> [[A]] to <8 x i8>
19*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x half> [[B]] to <8 x i8>
20*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = bitcast <4 x half> [[C]] to <8 x i8>
21*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL1_I:%.*]] = bitcast <8 x i8> [[TMP1]] to <4 x i16>
22*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL2_I:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x i16>
23*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL3_I:%.*]] = and <4 x i16> [[A]], [[VBSL1_I]]
24*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = xor <4 x i16> [[A]], splat (i16 -1)
25*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL4_I:%.*]] = and <4 x i16> [[TMP3]], [[VBSL2_I]]
26*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL5_I:%.*]] = or <4 x i16> [[VBSL3_I]], [[VBSL4_I]]
27*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = bitcast <4 x i16> [[VBSL5_I]] to <4 x half>
28*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[TMP4]]
29*207e5cccSFangrui Song //
30*207e5cccSFangrui Song float16x4_t test_vbsl_f16(uint16x4_t a, float16x4_t b, float16x4_t c) {
31*207e5cccSFangrui Song   return vbsl_f16(a, b, c);
32*207e5cccSFangrui Song }
33*207e5cccSFangrui Song 
34*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vbslq_f16
35*207e5cccSFangrui Song // CHECK-SAME: (<8 x i16> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]], <8 x half> noundef [[C:%.*]]) #[[ATTR0]] {
36*207e5cccSFangrui Song // CHECK-NEXT:  entry:
37*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x i16> [[A]] to <16 x i8>
38*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x half> [[B]] to <16 x i8>
39*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = bitcast <8 x half> [[C]] to <16 x i8>
40*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL1_I:%.*]] = bitcast <16 x i8> [[TMP1]] to <8 x i16>
41*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL2_I:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16>
42*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL3_I:%.*]] = and <8 x i16> [[A]], [[VBSL1_I]]
43*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = xor <8 x i16> [[A]], splat (i16 -1)
44*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL4_I:%.*]] = and <8 x i16> [[TMP3]], [[VBSL2_I]]
45*207e5cccSFangrui Song // CHECK-NEXT:    [[VBSL5_I:%.*]] = or <8 x i16> [[VBSL3_I]], [[VBSL4_I]]
46*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = bitcast <8 x i16> [[VBSL5_I]] to <8 x half>
47*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[TMP4]]
48*207e5cccSFangrui Song //
49*207e5cccSFangrui Song float16x8_t test_vbslq_f16(uint16x8_t a, float16x8_t b, float16x8_t c) {
50*207e5cccSFangrui Song   return vbslq_f16(a, b, c);
51*207e5cccSFangrui Song }
52*207e5cccSFangrui Song 
53*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vzip_f16
54*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
55*207e5cccSFangrui Song // CHECK-NEXT:  entry:
56*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL_I:%.*]] = alloca [[STRUCT_FLOAT16X4X2_T:%.*]], align 8
57*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL:%.*]] = alloca [[STRUCT_FLOAT16X4X2_T]], align 8
58*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x half> [[A]] to <8 x i8>
59*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x half> [[B]] to <8 x i8>
60*207e5cccSFangrui Song // CHECK-NEXT:    [[VZIP_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 0, i32 4, i32 1, i32 5>
61*207e5cccSFangrui Song // CHECK-NEXT:    store <4 x half> [[VZIP_I]], ptr [[RETVAL_I]], align 8
62*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds <4 x half>, ptr [[RETVAL_I]], i32 1
63*207e5cccSFangrui Song // CHECK-NEXT:    [[VZIP1_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 2, i32 6, i32 3, i32 7>
64*207e5cccSFangrui Song // CHECK-NEXT:    store <4 x half> [[VZIP1_I]], ptr [[TMP2]], align 8
65*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = load [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL_I]], align 8
66*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds nuw [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL]], i32 0, i32 0
67*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP5:%.*]] = extractvalue [[STRUCT_FLOAT16X4X2_T]] [[TMP3]], 0
68*207e5cccSFangrui Song // CHECK-NEXT:    store [2 x <4 x half>] [[TMP5]], ptr [[TMP4]], align 8
69*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP6:%.*]] = load [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL]], align 8
70*207e5cccSFangrui Song // CHECK-NEXT:    ret [[STRUCT_FLOAT16X4X2_T]] [[TMP6]]
71*207e5cccSFangrui Song //
72*207e5cccSFangrui Song float16x4x2_t test_vzip_f16(float16x4_t a, float16x4_t b) {
73*207e5cccSFangrui Song   return vzip_f16(a, b);
74*207e5cccSFangrui Song }
75*207e5cccSFangrui Song 
76*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vzipq_f16
77*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
78*207e5cccSFangrui Song // CHECK-NEXT:  entry:
79*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL_I:%.*]] = alloca [[STRUCT_FLOAT16X8X2_T:%.*]], align 16
80*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL:%.*]] = alloca [[STRUCT_FLOAT16X8X2_T]], align 16
81*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x half> [[A]] to <16 x i8>
82*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x half> [[B]] to <16 x i8>
83*207e5cccSFangrui Song // CHECK-NEXT:    [[VZIP_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
84*207e5cccSFangrui Song // CHECK-NEXT:    store <8 x half> [[VZIP_I]], ptr [[RETVAL_I]], align 16
85*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds <8 x half>, ptr [[RETVAL_I]], i32 1
86*207e5cccSFangrui Song // CHECK-NEXT:    [[VZIP1_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
87*207e5cccSFangrui Song // CHECK-NEXT:    store <8 x half> [[VZIP1_I]], ptr [[TMP2]], align 16
88*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = load [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL_I]], align 16
89*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds nuw [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL]], i32 0, i32 0
90*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP5:%.*]] = extractvalue [[STRUCT_FLOAT16X8X2_T]] [[TMP3]], 0
91*207e5cccSFangrui Song // CHECK-NEXT:    store [2 x <8 x half>] [[TMP5]], ptr [[TMP4]], align 16
92*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP6:%.*]] = load [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL]], align 16
93*207e5cccSFangrui Song // CHECK-NEXT:    ret [[STRUCT_FLOAT16X8X2_T]] [[TMP6]]
94*207e5cccSFangrui Song //
95*207e5cccSFangrui Song float16x8x2_t test_vzipq_f16(float16x8_t a, float16x8_t b) {
96*207e5cccSFangrui Song   return vzipq_f16(a, b);
97*207e5cccSFangrui Song }
98*207e5cccSFangrui Song 
99*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vuzp_f16
100*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
101*207e5cccSFangrui Song // CHECK-NEXT:  entry:
102*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL_I:%.*]] = alloca [[STRUCT_FLOAT16X4X2_T:%.*]], align 8
103*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL:%.*]] = alloca [[STRUCT_FLOAT16X4X2_T]], align 8
104*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x half> [[A]] to <8 x i8>
105*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x half> [[B]] to <8 x i8>
106*207e5cccSFangrui Song // CHECK-NEXT:    [[VUZP_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 0, i32 2, i32 4, i32 6>
107*207e5cccSFangrui Song // CHECK-NEXT:    store <4 x half> [[VUZP_I]], ptr [[RETVAL_I]], align 8
108*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds <4 x half>, ptr [[RETVAL_I]], i32 1
109*207e5cccSFangrui Song // CHECK-NEXT:    [[VUZP1_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 1, i32 3, i32 5, i32 7>
110*207e5cccSFangrui Song // CHECK-NEXT:    store <4 x half> [[VUZP1_I]], ptr [[TMP2]], align 8
111*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = load [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL_I]], align 8
112*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds nuw [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL]], i32 0, i32 0
113*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP5:%.*]] = extractvalue [[STRUCT_FLOAT16X4X2_T]] [[TMP3]], 0
114*207e5cccSFangrui Song // CHECK-NEXT:    store [2 x <4 x half>] [[TMP5]], ptr [[TMP4]], align 8
115*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP6:%.*]] = load [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL]], align 8
116*207e5cccSFangrui Song // CHECK-NEXT:    ret [[STRUCT_FLOAT16X4X2_T]] [[TMP6]]
117*207e5cccSFangrui Song //
118*207e5cccSFangrui Song float16x4x2_t test_vuzp_f16(float16x4_t a, float16x4_t b) {
119*207e5cccSFangrui Song   return vuzp_f16(a, b);
120*207e5cccSFangrui Song }
121*207e5cccSFangrui Song 
122*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vuzpq_f16
123*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
124*207e5cccSFangrui Song // CHECK-NEXT:  entry:
125*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL_I:%.*]] = alloca [[STRUCT_FLOAT16X8X2_T:%.*]], align 16
126*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL:%.*]] = alloca [[STRUCT_FLOAT16X8X2_T]], align 16
127*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x half> [[A]] to <16 x i8>
128*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x half> [[B]] to <16 x i8>
129*207e5cccSFangrui Song // CHECK-NEXT:    [[VUZP_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
130*207e5cccSFangrui Song // CHECK-NEXT:    store <8 x half> [[VUZP_I]], ptr [[RETVAL_I]], align 16
131*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds <8 x half>, ptr [[RETVAL_I]], i32 1
132*207e5cccSFangrui Song // CHECK-NEXT:    [[VUZP1_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
133*207e5cccSFangrui Song // CHECK-NEXT:    store <8 x half> [[VUZP1_I]], ptr [[TMP2]], align 16
134*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = load [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL_I]], align 16
135*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds nuw [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL]], i32 0, i32 0
136*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP5:%.*]] = extractvalue [[STRUCT_FLOAT16X8X2_T]] [[TMP3]], 0
137*207e5cccSFangrui Song // CHECK-NEXT:    store [2 x <8 x half>] [[TMP5]], ptr [[TMP4]], align 16
138*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP6:%.*]] = load [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL]], align 16
139*207e5cccSFangrui Song // CHECK-NEXT:    ret [[STRUCT_FLOAT16X8X2_T]] [[TMP6]]
140*207e5cccSFangrui Song //
141*207e5cccSFangrui Song float16x8x2_t test_vuzpq_f16(float16x8_t a, float16x8_t b) {
142*207e5cccSFangrui Song   return vuzpq_f16(a, b);
143*207e5cccSFangrui Song }
144*207e5cccSFangrui Song 
145*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vtrn_f16
146*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
147*207e5cccSFangrui Song // CHECK-NEXT:  entry:
148*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL_I:%.*]] = alloca [[STRUCT_FLOAT16X4X2_T:%.*]], align 8
149*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL:%.*]] = alloca [[STRUCT_FLOAT16X4X2_T]], align 8
150*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x half> [[A]] to <8 x i8>
151*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x half> [[B]] to <8 x i8>
152*207e5cccSFangrui Song // CHECK-NEXT:    [[VTRN_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 0, i32 4, i32 2, i32 6>
153*207e5cccSFangrui Song // CHECK-NEXT:    store <4 x half> [[VTRN_I]], ptr [[RETVAL_I]], align 8
154*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds <4 x half>, ptr [[RETVAL_I]], i32 1
155*207e5cccSFangrui Song // CHECK-NEXT:    [[VTRN1_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 1, i32 5, i32 3, i32 7>
156*207e5cccSFangrui Song // CHECK-NEXT:    store <4 x half> [[VTRN1_I]], ptr [[TMP2]], align 8
157*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = load [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL_I]], align 8
158*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds nuw [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL]], i32 0, i32 0
159*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP5:%.*]] = extractvalue [[STRUCT_FLOAT16X4X2_T]] [[TMP3]], 0
160*207e5cccSFangrui Song // CHECK-NEXT:    store [2 x <4 x half>] [[TMP5]], ptr [[TMP4]], align 8
161*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP6:%.*]] = load [[STRUCT_FLOAT16X4X2_T]], ptr [[RETVAL]], align 8
162*207e5cccSFangrui Song // CHECK-NEXT:    ret [[STRUCT_FLOAT16X4X2_T]] [[TMP6]]
163*207e5cccSFangrui Song //
164*207e5cccSFangrui Song float16x4x2_t test_vtrn_f16(float16x4_t a, float16x4_t b) {
165*207e5cccSFangrui Song   return vtrn_f16(a, b);
166*207e5cccSFangrui Song }
167*207e5cccSFangrui Song 
168*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vtrnq_f16
169*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
170*207e5cccSFangrui Song // CHECK-NEXT:  entry:
171*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL_I:%.*]] = alloca [[STRUCT_FLOAT16X8X2_T:%.*]], align 16
172*207e5cccSFangrui Song // CHECK-NEXT:    [[RETVAL:%.*]] = alloca [[STRUCT_FLOAT16X8X2_T]], align 16
173*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x half> [[A]] to <16 x i8>
174*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x half> [[B]] to <16 x i8>
175*207e5cccSFangrui Song // CHECK-NEXT:    [[VTRN_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
176*207e5cccSFangrui Song // CHECK-NEXT:    store <8 x half> [[VTRN_I]], ptr [[RETVAL_I]], align 16
177*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds <8 x half>, ptr [[RETVAL_I]], i32 1
178*207e5cccSFangrui Song // CHECK-NEXT:    [[VTRN1_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
179*207e5cccSFangrui Song // CHECK-NEXT:    store <8 x half> [[VTRN1_I]], ptr [[TMP2]], align 16
180*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = load [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL_I]], align 16
181*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP4:%.*]] = getelementptr inbounds nuw [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL]], i32 0, i32 0
182*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP5:%.*]] = extractvalue [[STRUCT_FLOAT16X8X2_T]] [[TMP3]], 0
183*207e5cccSFangrui Song // CHECK-NEXT:    store [2 x <8 x half>] [[TMP5]], ptr [[TMP4]], align 16
184*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP6:%.*]] = load [[STRUCT_FLOAT16X8X2_T]], ptr [[RETVAL]], align 16
185*207e5cccSFangrui Song // CHECK-NEXT:    ret [[STRUCT_FLOAT16X8X2_T]] [[TMP6]]
186*207e5cccSFangrui Song //
187*207e5cccSFangrui Song float16x8x2_t test_vtrnq_f16(float16x8_t a, float16x8_t b) {
188*207e5cccSFangrui Song   return vtrnq_f16(a, b);
189*207e5cccSFangrui Song }
190*207e5cccSFangrui Song 
191*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmov_n_f16
192*207e5cccSFangrui Song // CHECK-SAME: (half noundef [[A:%.*]]) #[[ATTR0]] {
193*207e5cccSFangrui Song // CHECK-NEXT:  entry:
194*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT:%.*]] = insertelement <4 x half> poison, half [[A]], i32 0
195*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT1:%.*]] = insertelement <4 x half> [[VECINIT]], half [[A]], i32 1
196*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT2:%.*]] = insertelement <4 x half> [[VECINIT1]], half [[A]], i32 2
197*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT3:%.*]] = insertelement <4 x half> [[VECINIT2]], half [[A]], i32 3
198*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[VECINIT3]]
199*207e5cccSFangrui Song //
200*207e5cccSFangrui Song float16x4_t test_vmov_n_f16(float16_t a) {
201*207e5cccSFangrui Song   return vmov_n_f16(a);
202*207e5cccSFangrui Song }
203*207e5cccSFangrui Song 
204*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vmovq_n_f16
205*207e5cccSFangrui Song // CHECK-SAME: (half noundef [[A:%.*]]) #[[ATTR0]] {
206*207e5cccSFangrui Song // CHECK-NEXT:  entry:
207*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT:%.*]] = insertelement <8 x half> poison, half [[A]], i32 0
208*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT1:%.*]] = insertelement <8 x half> [[VECINIT]], half [[A]], i32 1
209*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT2:%.*]] = insertelement <8 x half> [[VECINIT1]], half [[A]], i32 2
210*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT3:%.*]] = insertelement <8 x half> [[VECINIT2]], half [[A]], i32 3
211*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT4:%.*]] = insertelement <8 x half> [[VECINIT3]], half [[A]], i32 4
212*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT5:%.*]] = insertelement <8 x half> [[VECINIT4]], half [[A]], i32 5
213*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT6:%.*]] = insertelement <8 x half> [[VECINIT5]], half [[A]], i32 6
214*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT7:%.*]] = insertelement <8 x half> [[VECINIT6]], half [[A]], i32 7
215*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[VECINIT7]]
216*207e5cccSFangrui Song //
217*207e5cccSFangrui Song float16x8_t test_vmovq_n_f16(float16_t a) {
218*207e5cccSFangrui Song   return vmovq_n_f16(a);
219*207e5cccSFangrui Song }
220*207e5cccSFangrui Song 
221*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vdup_n_f16
222*207e5cccSFangrui Song // CHECK-SAME: (half noundef [[A:%.*]]) #[[ATTR0]] {
223*207e5cccSFangrui Song // CHECK-NEXT:  entry:
224*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT:%.*]] = insertelement <4 x half> poison, half [[A]], i32 0
225*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT1:%.*]] = insertelement <4 x half> [[VECINIT]], half [[A]], i32 1
226*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT2:%.*]] = insertelement <4 x half> [[VECINIT1]], half [[A]], i32 2
227*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT3:%.*]] = insertelement <4 x half> [[VECINIT2]], half [[A]], i32 3
228*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[VECINIT3]]
229*207e5cccSFangrui Song //
230*207e5cccSFangrui Song float16x4_t test_vdup_n_f16(float16_t a) {
231*207e5cccSFangrui Song   return vdup_n_f16(a);
232*207e5cccSFangrui Song }
233*207e5cccSFangrui Song 
234*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vdupq_n_f16
235*207e5cccSFangrui Song // CHECK-SAME: (half noundef [[A:%.*]]) #[[ATTR0]] {
236*207e5cccSFangrui Song // CHECK-NEXT:  entry:
237*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT:%.*]] = insertelement <8 x half> poison, half [[A]], i32 0
238*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT1:%.*]] = insertelement <8 x half> [[VECINIT]], half [[A]], i32 1
239*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT2:%.*]] = insertelement <8 x half> [[VECINIT1]], half [[A]], i32 2
240*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT3:%.*]] = insertelement <8 x half> [[VECINIT2]], half [[A]], i32 3
241*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT4:%.*]] = insertelement <8 x half> [[VECINIT3]], half [[A]], i32 4
242*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT5:%.*]] = insertelement <8 x half> [[VECINIT4]], half [[A]], i32 5
243*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT6:%.*]] = insertelement <8 x half> [[VECINIT5]], half [[A]], i32 6
244*207e5cccSFangrui Song // CHECK-NEXT:    [[VECINIT7:%.*]] = insertelement <8 x half> [[VECINIT6]], half [[A]], i32 7
245*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[VECINIT7]]
246*207e5cccSFangrui Song //
247*207e5cccSFangrui Song float16x8_t test_vdupq_n_f16(float16_t a) {
248*207e5cccSFangrui Song   return vdupq_n_f16(a);
249*207e5cccSFangrui Song }
250*207e5cccSFangrui Song 
251*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vdup_lane_f16
252*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]]) #[[ATTR0]] {
253*207e5cccSFangrui Song // CHECK-NEXT:  entry:
254*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x half> [[A]] to <8 x i8>
255*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half>
256*207e5cccSFangrui Song // CHECK-NEXT:    [[LANE:%.*]] = shufflevector <4 x half> [[TMP1]], <4 x half> [[TMP1]], <4 x i32> <i32 3, i32 3, i32 3, i32 3>
257*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[LANE]]
258*207e5cccSFangrui Song //
259*207e5cccSFangrui Song float16x4_t test_vdup_lane_f16(float16x4_t a) {
260*207e5cccSFangrui Song   return vdup_lane_f16(a, 3);
261*207e5cccSFangrui Song }
262*207e5cccSFangrui Song 
263*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vdupq_lane_f16
264*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]]) #[[ATTR0]] {
265*207e5cccSFangrui Song // CHECK-NEXT:  entry:
266*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x half> [[A]] to <8 x i8>
267*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half>
268*207e5cccSFangrui Song // CHECK-NEXT:    [[LANE:%.*]] = shufflevector <4 x half> [[TMP1]], <4 x half> [[TMP1]], <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
269*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[LANE]]
270*207e5cccSFangrui Song //
271*207e5cccSFangrui Song float16x8_t test_vdupq_lane_f16(float16x4_t a) {
272*207e5cccSFangrui Song   return vdupq_lane_f16(a, 3);
273*207e5cccSFangrui Song }
274*207e5cccSFangrui Song 
275*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vdup_laneq_f16
276*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]]) #[[ATTR0]] {
277*207e5cccSFangrui Song // CHECK-NEXT:  entry:
278*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x half> [[A]] to <16 x i8>
279*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half>
280*207e5cccSFangrui Song // CHECK-NEXT:    [[LANE:%.*]] = shufflevector <8 x half> [[TMP1]], <8 x half> [[TMP1]], <4 x i32> <i32 1, i32 1, i32 1, i32 1>
281*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[LANE]]
282*207e5cccSFangrui Song //
283*207e5cccSFangrui Song float16x4_t test_vdup_laneq_f16(float16x8_t a) {
284*207e5cccSFangrui Song   return vdup_laneq_f16(a, 1);
285*207e5cccSFangrui Song }
286*207e5cccSFangrui Song 
287*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vdupq_laneq_f16
288*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]]) #[[ATTR0]] {
289*207e5cccSFangrui Song // CHECK-NEXT:  entry:
290*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x half> [[A]] to <16 x i8>
291*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half>
292*207e5cccSFangrui Song // CHECK-NEXT:    [[LANE:%.*]] = shufflevector <8 x half> [[TMP1]], <8 x half> [[TMP1]], <8 x i32> <i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7, i32 7>
293*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[LANE]]
294*207e5cccSFangrui Song //
295*207e5cccSFangrui Song float16x8_t test_vdupq_laneq_f16(float16x8_t a) {
296*207e5cccSFangrui Song   return vdupq_laneq_f16(a, 7);
297*207e5cccSFangrui Song }
298*207e5cccSFangrui Song 
299*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vext_f16
300*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
301*207e5cccSFangrui Song // CHECK-NEXT:  entry:
302*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x half> [[A]] to <8 x i8>
303*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x half> [[B]] to <8 x i8>
304*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half>
305*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = bitcast <8 x i8> [[TMP1]] to <4 x half>
306*207e5cccSFangrui Song // CHECK-NEXT:    [[VEXT:%.*]] = shufflevector <4 x half> [[TMP2]], <4 x half> [[TMP3]], <4 x i32> <i32 2, i32 3, i32 4, i32 5>
307*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[VEXT]]
308*207e5cccSFangrui Song //
309*207e5cccSFangrui Song float16x4_t test_vext_f16(float16x4_t a, float16x4_t b) {
310*207e5cccSFangrui Song   return vext_f16(a, b, 2);
311*207e5cccSFangrui Song }
312*207e5cccSFangrui Song 
313*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vextq_f16
314*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
315*207e5cccSFangrui Song // CHECK-NEXT:  entry:
316*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x half> [[A]] to <16 x i8>
317*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = bitcast <8 x half> [[B]] to <16 x i8>
318*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP2:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half>
319*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP3:%.*]] = bitcast <16 x i8> [[TMP1]] to <8 x half>
320*207e5cccSFangrui Song // CHECK-NEXT:    [[VEXT:%.*]] = shufflevector <8 x half> [[TMP2]], <8 x half> [[TMP3]], <8 x i32> <i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12>
321*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[VEXT]]
322*207e5cccSFangrui Song //
323*207e5cccSFangrui Song float16x8_t test_vextq_f16(float16x8_t a, float16x8_t b) {
324*207e5cccSFangrui Song   return vextq_f16(a, b, 5);
325*207e5cccSFangrui Song }
326*207e5cccSFangrui Song 
327*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vrev64_f16
328*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]]) #[[ATTR0]] {
329*207e5cccSFangrui Song // CHECK-NEXT:  entry:
330*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[A]], <4 x i32> <i32 3, i32 2, i32 1, i32 0>
331*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
332*207e5cccSFangrui Song //
333*207e5cccSFangrui Song float16x4_t test_vrev64_f16(float16x4_t a) {
334*207e5cccSFangrui Song   return vrev64_f16(a);
335*207e5cccSFangrui Song }
336*207e5cccSFangrui Song 
337*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vrev64q_f16
338*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]]) #[[ATTR0]] {
339*207e5cccSFangrui Song // CHECK-NEXT:  entry:
340*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[A]], <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
341*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
342*207e5cccSFangrui Song //
343*207e5cccSFangrui Song float16x8_t test_vrev64q_f16(float16x8_t a) {
344*207e5cccSFangrui Song   return vrev64q_f16(a);
345*207e5cccSFangrui Song }
346*207e5cccSFangrui Song 
347*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vzip1_f16
348*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
349*207e5cccSFangrui Song // CHECK-NEXT:  entry:
350*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 0, i32 4, i32 1, i32 5>
351*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
352*207e5cccSFangrui Song //
353*207e5cccSFangrui Song float16x4_t test_vzip1_f16(float16x4_t a, float16x4_t b) {
354*207e5cccSFangrui Song   return vzip1_f16(a, b);
355*207e5cccSFangrui Song }
356*207e5cccSFangrui Song 
357*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vzip1q_f16
358*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
359*207e5cccSFangrui Song // CHECK-NEXT:  entry:
360*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
361*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
362*207e5cccSFangrui Song //
363*207e5cccSFangrui Song float16x8_t test_vzip1q_f16(float16x8_t a, float16x8_t b) {
364*207e5cccSFangrui Song   return vzip1q_f16(a, b);
365*207e5cccSFangrui Song }
366*207e5cccSFangrui Song 
367*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vzip2_f16
368*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
369*207e5cccSFangrui Song // CHECK-NEXT:  entry:
370*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 2, i32 6, i32 3, i32 7>
371*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
372*207e5cccSFangrui Song //
373*207e5cccSFangrui Song float16x4_t test_vzip2_f16(float16x4_t a, float16x4_t b) {
374*207e5cccSFangrui Song   return vzip2_f16(a, b);
375*207e5cccSFangrui Song }
376*207e5cccSFangrui Song 
377*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vzip2q_f16
378*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
379*207e5cccSFangrui Song // CHECK-NEXT:  entry:
380*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
381*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
382*207e5cccSFangrui Song //
383*207e5cccSFangrui Song float16x8_t test_vzip2q_f16(float16x8_t a, float16x8_t b) {
384*207e5cccSFangrui Song   return vzip2q_f16(a, b);
385*207e5cccSFangrui Song }
386*207e5cccSFangrui Song 
387*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vuzp1_f16
388*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
389*207e5cccSFangrui Song // CHECK-NEXT:  entry:
390*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 0, i32 2, i32 4, i32 6>
391*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
392*207e5cccSFangrui Song //
393*207e5cccSFangrui Song float16x4_t test_vuzp1_f16(float16x4_t a, float16x4_t b) {
394*207e5cccSFangrui Song   return vuzp1_f16(a, b);
395*207e5cccSFangrui Song }
396*207e5cccSFangrui Song 
397*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vuzp1q_f16
398*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
399*207e5cccSFangrui Song // CHECK-NEXT:  entry:
400*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
401*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
402*207e5cccSFangrui Song //
403*207e5cccSFangrui Song float16x8_t test_vuzp1q_f16(float16x8_t a, float16x8_t b) {
404*207e5cccSFangrui Song   return vuzp1q_f16(a, b);
405*207e5cccSFangrui Song }
406*207e5cccSFangrui Song 
407*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vuzp2_f16
408*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
409*207e5cccSFangrui Song // CHECK-NEXT:  entry:
410*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 1, i32 3, i32 5, i32 7>
411*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
412*207e5cccSFangrui Song //
413*207e5cccSFangrui Song float16x4_t test_vuzp2_f16(float16x4_t a, float16x4_t b) {
414*207e5cccSFangrui Song   return vuzp2_f16(a, b);
415*207e5cccSFangrui Song }
416*207e5cccSFangrui Song 
417*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vuzp2q_f16
418*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
419*207e5cccSFangrui Song // CHECK-NEXT:  entry:
420*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
421*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
422*207e5cccSFangrui Song //
423*207e5cccSFangrui Song float16x8_t test_vuzp2q_f16(float16x8_t a, float16x8_t b) {
424*207e5cccSFangrui Song   return vuzp2q_f16(a, b);
425*207e5cccSFangrui Song }
426*207e5cccSFangrui Song 
427*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vtrn1_f16
428*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
429*207e5cccSFangrui Song // CHECK-NEXT:  entry:
430*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 0, i32 4, i32 2, i32 6>
431*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
432*207e5cccSFangrui Song //
433*207e5cccSFangrui Song float16x4_t test_vtrn1_f16(float16x4_t a, float16x4_t b) {
434*207e5cccSFangrui Song   return vtrn1_f16(a, b);
435*207e5cccSFangrui Song }
436*207e5cccSFangrui Song 
437*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vtrn1q_f16
438*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
439*207e5cccSFangrui Song // CHECK-NEXT:  entry:
440*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
441*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
442*207e5cccSFangrui Song //
443*207e5cccSFangrui Song float16x8_t test_vtrn1q_f16(float16x8_t a, float16x8_t b) {
444*207e5cccSFangrui Song   return vtrn1q_f16(a, b);
445*207e5cccSFangrui Song }
446*207e5cccSFangrui Song 
447*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vtrn2_f16
448*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]]) #[[ATTR0]] {
449*207e5cccSFangrui Song // CHECK-NEXT:  entry:
450*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <4 x half> [[A]], <4 x half> [[B]], <4 x i32> <i32 1, i32 5, i32 3, i32 7>
451*207e5cccSFangrui Song // CHECK-NEXT:    ret <4 x half> [[SHUFFLE_I]]
452*207e5cccSFangrui Song //
453*207e5cccSFangrui Song float16x4_t test_vtrn2_f16(float16x4_t a, float16x4_t b) {
454*207e5cccSFangrui Song   return vtrn2_f16(a, b);
455*207e5cccSFangrui Song }
456*207e5cccSFangrui Song 
457*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vtrn2q_f16
458*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[A:%.*]], <8 x half> noundef [[B:%.*]]) #[[ATTR0]] {
459*207e5cccSFangrui Song // CHECK-NEXT:  entry:
460*207e5cccSFangrui Song // CHECK-NEXT:    [[SHUFFLE_I:%.*]] = shufflevector <8 x half> [[A]], <8 x half> [[B]], <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
461*207e5cccSFangrui Song // CHECK-NEXT:    ret <8 x half> [[SHUFFLE_I]]
462*207e5cccSFangrui Song //
463*207e5cccSFangrui Song float16x8_t test_vtrn2q_f16(float16x8_t a, float16x8_t b) {
464*207e5cccSFangrui Song   return vtrn2q_f16(a, b);
465*207e5cccSFangrui Song }
466*207e5cccSFangrui Song 
467*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vduph_laneq_f16
468*207e5cccSFangrui Song // CHECK-SAME: (<8 x half> noundef [[VEC:%.*]]) #[[ATTR0]] {
469*207e5cccSFangrui Song // CHECK-NEXT:  entry:
470*207e5cccSFangrui Song // CHECK-NEXT:    [[VGETQ_LANE:%.*]] = extractelement <8 x half> [[VEC]], i32 7
471*207e5cccSFangrui Song // CHECK-NEXT:    ret half [[VGETQ_LANE]]
472*207e5cccSFangrui Song //
473*207e5cccSFangrui Song float16_t test_vduph_laneq_f16(float16x8_t vec) {
474*207e5cccSFangrui Song   return vduph_laneq_f16(vec, 7);
475*207e5cccSFangrui Song }
476*207e5cccSFangrui Song 
477*207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@test_vduph_lane_f16
478*207e5cccSFangrui Song // CHECK-SAME: (<4 x half> noundef [[VEC:%.*]]) #[[ATTR0]] {
479*207e5cccSFangrui Song // CHECK-NEXT:  entry:
480*207e5cccSFangrui Song // CHECK-NEXT:    [[VGET_LANE:%.*]] = extractelement <4 x half> [[VEC]], i32 3
481*207e5cccSFangrui Song // CHECK-NEXT:    ret half [[VGET_LANE]]
482*207e5cccSFangrui Song //
483*207e5cccSFangrui Song float16_t test_vduph_lane_f16(float16x4_t vec) {
484*207e5cccSFangrui Song   return vduph_lane_f16(vec, 3);
485*207e5cccSFangrui Song }
486