1 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
2 // RUN: -disable-O0-optnone -emit-llvm -o - %s \
3 // RUN: | opt -S -passes=mem2reg | FileCheck %s
5 // REQUIRES: aarch64-registered-target || arm-registered-target
9 // CHECK-LABEL: define{{.*}} <8 x i8> @test_vget_high_s8(<16 x i8> noundef %a) #0 {
10 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
11 // CHECK: ret <8 x i8> [[SHUFFLE_I]]
12 int8x8_t
test_vget_high_s8(int8x16_t a
) {
13 return vget_high_s8(a
);
16 // CHECK-LABEL: define{{.*}} <4 x i16> @test_vget_high_s16(<8 x i16> noundef %a) #0 {
17 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
18 // CHECK: ret <4 x i16> [[SHUFFLE_I]]
19 int16x4_t
test_vget_high_s16(int16x8_t a
) {
20 return vget_high_s16(a
);
23 // CHECK-LABEL: define{{.*}} <2 x i32> @test_vget_high_s32(<4 x i32> noundef %a) #0 {
24 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
25 // CHECK: ret <2 x i32> [[SHUFFLE_I]]
26 int32x2_t
test_vget_high_s32(int32x4_t a
) {
27 return vget_high_s32(a
);
30 // CHECK-LABEL: define{{.*}} <1 x i64> @test_vget_high_s64(<2 x i64> noundef %a) #0 {
31 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> <i32 1>
32 // CHECK: ret <1 x i64> [[SHUFFLE_I]]
33 int64x1_t
test_vget_high_s64(int64x2_t a
) {
34 return vget_high_s64(a
);
37 // CHECK-LABEL: define{{.*}} <8 x i8> @test_vget_high_u8(<16 x i8> noundef %a) #0 {
38 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
39 // CHECK: ret <8 x i8> [[SHUFFLE_I]]
40 uint8x8_t
test_vget_high_u8(uint8x16_t a
) {
41 return vget_high_u8(a
);
44 // CHECK-LABEL: define{{.*}} <4 x i16> @test_vget_high_u16(<8 x i16> noundef %a) #0 {
45 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
46 // CHECK: ret <4 x i16> [[SHUFFLE_I]]
47 uint16x4_t
test_vget_high_u16(uint16x8_t a
) {
48 return vget_high_u16(a
);
51 // CHECK-LABEL: define{{.*}} <2 x i32> @test_vget_high_u32(<4 x i32> noundef %a) #0 {
52 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
53 // CHECK: ret <2 x i32> [[SHUFFLE_I]]
54 uint32x2_t
test_vget_high_u32(uint32x4_t a
) {
55 return vget_high_u32(a
);
58 // CHECK-LABEL: define{{.*}} <1 x i64> @test_vget_high_u64(<2 x i64> noundef %a) #0 {
59 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> <i32 1>
60 // CHECK: ret <1 x i64> [[SHUFFLE_I]]
61 uint64x1_t
test_vget_high_u64(uint64x2_t a
) {
62 return vget_high_u64(a
);
65 // CHECK-LABEL: define{{.*}} <1 x i64> @test_vget_high_p64(<2 x i64> noundef %a) #0 {
66 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> <i32 1>
67 // CHECK: ret <1 x i64> [[SHUFFLE_I]]
68 poly64x1_t
test_vget_high_p64(poly64x2_t a
) {
69 return vget_high_p64(a
);
72 // CHECK-LABEL: define{{.*}} <4 x half> @test_vget_high_f16(<8 x half> noundef %a) #0 {
73 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x half> %a, <8 x half> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
74 // CHECK: ret <4 x half> [[SHUFFLE_I]]
75 float16x4_t
test_vget_high_f16(float16x8_t a
) {
76 return vget_high_f16(a
);
79 // CHECK-LABEL: define{{.*}} <2 x float> @test_vget_high_f32(<4 x float> noundef %a) #0 {
80 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <4 x float> %a, <4 x float> %a, <2 x i32> <i32 2, i32 3>
81 // CHECK: ret <2 x float> [[SHUFFLE_I]]
82 float32x2_t
test_vget_high_f32(float32x4_t a
) {
83 return vget_high_f32(a
);
86 // CHECK-LABEL: define{{.*}} <8 x i8> @test_vget_high_p8(<16 x i8> noundef %a) #0 {
87 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
88 // CHECK: ret <8 x i8> [[SHUFFLE_I]]
89 poly8x8_t
test_vget_high_p8(poly8x16_t a
) {
90 return vget_high_p8(a
);
93 // CHECK-LABEL: define{{.*}} <4 x i16> @test_vget_high_p16(<8 x i16> noundef %a) #0 {
94 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
95 // CHECK: ret <4 x i16> [[SHUFFLE_I]]
96 poly16x4_t
test_vget_high_p16(poly16x8_t a
) {
97 return vget_high_p16(a
);
100 // CHECK-LABEL: define{{.*}} <1 x double> @test_vget_high_f64(<2 x double> noundef %a) #0 {
101 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x double> %a, <2 x double> %a, <1 x i32> <i32 1>
102 // CHECK: ret <1 x double> [[SHUFFLE_I]]
103 float64x1_t
test_vget_high_f64(float64x2_t a
) {
104 return vget_high_f64(a
);
107 // CHECK-LABEL: define{{.*}} <8 x i8> @test_vget_low_s8(<16 x i8> noundef %a) #0 {
108 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
109 // CHECK: ret <8 x i8> [[SHUFFLE_I]]
110 int8x8_t
test_vget_low_s8(int8x16_t a
) {
111 return vget_low_s8(a
);
114 // CHECK-LABEL: define{{.*}} <4 x i16> @test_vget_low_s16(<8 x i16> noundef %a) #0 {
115 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
116 // CHECK: ret <4 x i16> [[SHUFFLE_I]]
117 int16x4_t
test_vget_low_s16(int16x8_t a
) {
118 return vget_low_s16(a
);
121 // CHECK-LABEL: define{{.*}} <2 x i32> @test_vget_low_s32(<4 x i32> noundef %a) #0 {
122 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 0, i32 1>
123 // CHECK: ret <2 x i32> [[SHUFFLE_I]]
124 int32x2_t
test_vget_low_s32(int32x4_t a
) {
125 return vget_low_s32(a
);
128 // CHECK-LABEL: define{{.*}} <1 x i64> @test_vget_low_s64(<2 x i64> noundef %a) #0 {
129 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> zeroinitializer
130 // CHECK: ret <1 x i64> [[SHUFFLE_I]]
131 int64x1_t
test_vget_low_s64(int64x2_t a
) {
132 return vget_low_s64(a
);
135 // CHECK-LABEL: define{{.*}} <8 x i8> @test_vget_low_u8(<16 x i8> noundef %a) #0 {
136 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
137 // CHECK: ret <8 x i8> [[SHUFFLE_I]]
138 uint8x8_t
test_vget_low_u8(uint8x16_t a
) {
139 return vget_low_u8(a
);
142 // CHECK-LABEL: define{{.*}} <4 x i16> @test_vget_low_u16(<8 x i16> noundef %a) #0 {
143 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
144 // CHECK: ret <4 x i16> [[SHUFFLE_I]]
145 uint16x4_t
test_vget_low_u16(uint16x8_t a
) {
146 return vget_low_u16(a
);
149 // CHECK-LABEL: define{{.*}} <2 x i32> @test_vget_low_u32(<4 x i32> noundef %a) #0 {
150 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 0, i32 1>
151 // CHECK: ret <2 x i32> [[SHUFFLE_I]]
152 uint32x2_t
test_vget_low_u32(uint32x4_t a
) {
153 return vget_low_u32(a
);
156 // CHECK-LABEL: define{{.*}} <1 x i64> @test_vget_low_u64(<2 x i64> noundef %a) #0 {
157 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> zeroinitializer
158 // CHECK: ret <1 x i64> [[SHUFFLE_I]]
159 uint64x1_t
test_vget_low_u64(uint64x2_t a
) {
160 return vget_low_u64(a
);
163 // CHECK-LABEL: define{{.*}} <1 x i64> @test_vget_low_p64(<2 x i64> noundef %a) #0 {
164 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> zeroinitializer
165 // CHECK: ret <1 x i64> [[SHUFFLE_I]]
166 poly64x1_t
test_vget_low_p64(poly64x2_t a
) {
167 return vget_low_p64(a
);
170 // CHECK-LABEL: define{{.*}} <4 x half> @test_vget_low_f16(<8 x half> noundef %a) #0 {
171 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x half> %a, <8 x half> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
172 // CHECK: ret <4 x half> [[SHUFFLE_I]]
173 float16x4_t
test_vget_low_f16(float16x8_t a
) {
174 return vget_low_f16(a
);
177 // CHECK-LABEL: define{{.*}} <2 x float> @test_vget_low_f32(<4 x float> noundef %a) #0 {
178 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <4 x float> %a, <4 x float> %a, <2 x i32> <i32 0, i32 1>
179 // CHECK: ret <2 x float> [[SHUFFLE_I]]
180 float32x2_t
test_vget_low_f32(float32x4_t a
) {
181 return vget_low_f32(a
);
184 // CHECK-LABEL: define{{.*}} <8 x i8> @test_vget_low_p8(<16 x i8> noundef %a) #0 {
185 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
186 // CHECK: ret <8 x i8> [[SHUFFLE_I]]
187 poly8x8_t
test_vget_low_p8(poly8x16_t a
) {
188 return vget_low_p8(a
);
191 // CHECK-LABEL: define{{.*}} <4 x i16> @test_vget_low_p16(<8 x i16> noundef %a) #0 {
192 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
193 // CHECK: ret <4 x i16> [[SHUFFLE_I]]
194 poly16x4_t
test_vget_low_p16(poly16x8_t a
) {
195 return vget_low_p16(a
);
198 // CHECK-LABEL: define{{.*}} <1 x double> @test_vget_low_f64(<2 x double> noundef %a) #0 {
199 // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <2 x double> %a, <2 x double> %a, <1 x i32> zeroinitializer
200 // CHECK: ret <1 x double> [[SHUFFLE_I]]
201 float64x1_t
test_vget_low_f64(float64x2_t a
) {
202 return vget_low_f64(a
);