1f4a2713aSLionel Sambuc // REQUIRES: aarch64-registered-target
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
3*0a6a1f1dSLionel Sambuc // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s --check-prefix CHECK-COMMON --check-prefix CHECK-ARM64
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc // Test new aarch64 intrinsics and types
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc #include <arm_neon.h>
8f4a2713aSLionel Sambuc
test_vget_high_s8(int8x16_t a)9f4a2713aSLionel Sambuc int8x8_t test_vget_high_s8(int8x16_t a) {
10*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_s8:
11f4a2713aSLionel Sambuc return vget_high_s8(a);
12*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
13f4a2713aSLionel Sambuc }
14f4a2713aSLionel Sambuc
test_vget_high_s16(int16x8_t a)15f4a2713aSLionel Sambuc int16x4_t test_vget_high_s16(int16x8_t a) {
16*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_s16:
17f4a2713aSLionel Sambuc return vget_high_s16(a);
18*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
19f4a2713aSLionel Sambuc }
20f4a2713aSLionel Sambuc
test_vget_high_s32(int32x4_t a)21f4a2713aSLionel Sambuc int32x2_t test_vget_high_s32(int32x4_t a) {
22*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_s32:
23f4a2713aSLionel Sambuc return vget_high_s32(a);
24*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
25f4a2713aSLionel Sambuc }
26f4a2713aSLionel Sambuc
test_vget_high_s64(int64x2_t a)27f4a2713aSLionel Sambuc int64x1_t test_vget_high_s64(int64x2_t a) {
28*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_s64:
29f4a2713aSLionel Sambuc return vget_high_s64(a);
30*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
31f4a2713aSLionel Sambuc }
32f4a2713aSLionel Sambuc
test_vget_high_u8(uint8x16_t a)33f4a2713aSLionel Sambuc uint8x8_t test_vget_high_u8(uint8x16_t a) {
34*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_u8:
35f4a2713aSLionel Sambuc return vget_high_u8(a);
36*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
37f4a2713aSLionel Sambuc }
38f4a2713aSLionel Sambuc
test_vget_high_u16(uint16x8_t a)39f4a2713aSLionel Sambuc uint16x4_t test_vget_high_u16(uint16x8_t a) {
40*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_u16:
41f4a2713aSLionel Sambuc return vget_high_u16(a);
42*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
43f4a2713aSLionel Sambuc }
44f4a2713aSLionel Sambuc
test_vget_high_u32(uint32x4_t a)45f4a2713aSLionel Sambuc uint32x2_t test_vget_high_u32(uint32x4_t a) {
46*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_u32:
47f4a2713aSLionel Sambuc return vget_high_u32(a);
48*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
49f4a2713aSLionel Sambuc }
50f4a2713aSLionel Sambuc
test_vget_high_u64(uint64x2_t a)51f4a2713aSLionel Sambuc uint64x1_t test_vget_high_u64(uint64x2_t a) {
52*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_u64:
53f4a2713aSLionel Sambuc return vget_high_u64(a);
54*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
55f4a2713aSLionel Sambuc }
56f4a2713aSLionel Sambuc
test_vget_high_p64(poly64x2_t a)57f4a2713aSLionel Sambuc poly64x1_t test_vget_high_p64(poly64x2_t a) {
58*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_p64:
59f4a2713aSLionel Sambuc return vget_high_p64(a);
60*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
61f4a2713aSLionel Sambuc }
62f4a2713aSLionel Sambuc
test_vget_high_f16(float16x8_t a)63f4a2713aSLionel Sambuc float16x4_t test_vget_high_f16(float16x8_t a) {
64*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_f16:
65f4a2713aSLionel Sambuc return vget_high_f16(a);
66*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
67f4a2713aSLionel Sambuc }
68f4a2713aSLionel Sambuc
test_vget_high_f32(float32x4_t a)69f4a2713aSLionel Sambuc float32x2_t test_vget_high_f32(float32x4_t a) {
70*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_f32:
71f4a2713aSLionel Sambuc return vget_high_f32(a);
72*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
73f4a2713aSLionel Sambuc }
74f4a2713aSLionel Sambuc
test_vget_high_p8(poly8x16_t a)75f4a2713aSLionel Sambuc poly8x8_t test_vget_high_p8(poly8x16_t a) {
76*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_p8:
77f4a2713aSLionel Sambuc return vget_high_p8(a);
78*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
79f4a2713aSLionel Sambuc }
80f4a2713aSLionel Sambuc
test_vget_high_p16(poly16x8_t a)81f4a2713aSLionel Sambuc poly16x4_t test_vget_high_p16(poly16x8_t a) {
82*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_p16
83f4a2713aSLionel Sambuc return vget_high_p16(a);
84*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
85f4a2713aSLionel Sambuc }
86f4a2713aSLionel Sambuc
test_vget_high_f64(float64x2_t a)87f4a2713aSLionel Sambuc float64x1_t test_vget_high_f64(float64x2_t a) {
88*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_high_f64
89f4a2713aSLionel Sambuc return vget_high_f64(a);
90*0a6a1f1dSLionel Sambuc // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
91f4a2713aSLionel Sambuc }
92f4a2713aSLionel Sambuc
test_vget_low_s8(int8x16_t a)93f4a2713aSLionel Sambuc int8x8_t test_vget_low_s8(int8x16_t a) {
94*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_s8:
95f4a2713aSLionel Sambuc return vget_low_s8(a);
96*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
97f4a2713aSLionel Sambuc }
98f4a2713aSLionel Sambuc
test_vget_low_s16(int16x8_t a)99f4a2713aSLionel Sambuc int16x4_t test_vget_low_s16(int16x8_t a) {
100*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_s16:
101f4a2713aSLionel Sambuc return vget_low_s16(a);
102*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
103f4a2713aSLionel Sambuc }
104f4a2713aSLionel Sambuc
test_vget_low_s32(int32x4_t a)105f4a2713aSLionel Sambuc int32x2_t test_vget_low_s32(int32x4_t a) {
106*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_s32:
107f4a2713aSLionel Sambuc return vget_low_s32(a);
108*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
109f4a2713aSLionel Sambuc }
110f4a2713aSLionel Sambuc
test_vget_low_s64(int64x2_t a)111f4a2713aSLionel Sambuc int64x1_t test_vget_low_s64(int64x2_t a) {
112*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_s64:
113f4a2713aSLionel Sambuc return vget_low_s64(a);
114*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
115f4a2713aSLionel Sambuc }
116f4a2713aSLionel Sambuc
test_vget_low_u8(uint8x16_t a)117f4a2713aSLionel Sambuc uint8x8_t test_vget_low_u8(uint8x16_t a) {
118*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_u8:
119f4a2713aSLionel Sambuc return vget_low_u8(a);
120*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
121f4a2713aSLionel Sambuc }
122f4a2713aSLionel Sambuc
test_vget_low_u16(uint16x8_t a)123f4a2713aSLionel Sambuc uint16x4_t test_vget_low_u16(uint16x8_t a) {
124*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_u16:
125f4a2713aSLionel Sambuc return vget_low_u16(a);
126*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
127f4a2713aSLionel Sambuc }
128f4a2713aSLionel Sambuc
test_vget_low_u32(uint32x4_t a)129f4a2713aSLionel Sambuc uint32x2_t test_vget_low_u32(uint32x4_t a) {
130*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_u32:
131f4a2713aSLionel Sambuc return vget_low_u32(a);
132*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
133f4a2713aSLionel Sambuc }
134f4a2713aSLionel Sambuc
test_vget_low_u64(uint64x2_t a)135f4a2713aSLionel Sambuc uint64x1_t test_vget_low_u64(uint64x2_t a) {
136*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_u64:
137f4a2713aSLionel Sambuc return vget_low_u64(a);
138*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
139f4a2713aSLionel Sambuc }
140f4a2713aSLionel Sambuc
test_vget_low_p64(poly64x2_t a)141f4a2713aSLionel Sambuc poly64x1_t test_vget_low_p64(poly64x2_t a) {
142*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_p64:
143f4a2713aSLionel Sambuc return vget_low_p64(a);
144*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
145f4a2713aSLionel Sambuc }
146f4a2713aSLionel Sambuc
test_vget_low_f16(float16x8_t a)147f4a2713aSLionel Sambuc float16x4_t test_vget_low_f16(float16x8_t a) {
148*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_f16:
149f4a2713aSLionel Sambuc return vget_low_f16(a);
150*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
151f4a2713aSLionel Sambuc }
152f4a2713aSLionel Sambuc
test_vget_low_f32(float32x4_t a)153f4a2713aSLionel Sambuc float32x2_t test_vget_low_f32(float32x4_t a) {
154*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_f32:
155f4a2713aSLionel Sambuc return vget_low_f32(a);
156*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
157f4a2713aSLionel Sambuc }
158f4a2713aSLionel Sambuc
test_vget_low_p8(poly8x16_t a)159f4a2713aSLionel Sambuc poly8x8_t test_vget_low_p8(poly8x16_t a) {
160*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_p8:
161f4a2713aSLionel Sambuc return vget_low_p8(a);
162*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
163f4a2713aSLionel Sambuc }
164f4a2713aSLionel Sambuc
test_vget_low_p16(poly16x8_t a)165f4a2713aSLionel Sambuc poly16x4_t test_vget_low_p16(poly16x8_t a) {
166*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_p16:
167f4a2713aSLionel Sambuc return vget_low_p16(a);
168*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
169f4a2713aSLionel Sambuc }
170f4a2713aSLionel Sambuc
test_vget_low_f64(float64x2_t a)171f4a2713aSLionel Sambuc float64x1_t test_vget_low_f64(float64x2_t a) {
172*0a6a1f1dSLionel Sambuc // CHECK-COMMON-LABEL: test_vget_low_f64:
173f4a2713aSLionel Sambuc return vget_low_f64(a);
174*0a6a1f1dSLionel Sambuc // CHECK-COMMON-NEXT: ret
175f4a2713aSLionel Sambuc }
176f4a2713aSLionel Sambuc
177