1f4a2713aSLionel Sambuc // REQUIRES: aarch64-registered-target
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
3f4a2713aSLionel Sambuc // RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
4f4a2713aSLionel Sambuc
5f4a2713aSLionel Sambuc // Test new aarch64 intrinsics and types
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc #include <arm_neon.h>
8f4a2713aSLionel Sambuc
test_vext_s8(int8x8_t a,int8x8_t b)9f4a2713aSLionel Sambuc int8x8_t test_vext_s8(int8x8_t a, int8x8_t b) {
10*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_s8
11f4a2713aSLionel Sambuc return vext_s8(a, b, 2);
12*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}}
13f4a2713aSLionel Sambuc }
14f4a2713aSLionel Sambuc
test_vext_s16(int16x4_t a,int16x4_t b)15f4a2713aSLionel Sambuc int16x4_t test_vext_s16(int16x4_t a, int16x4_t b) {
16*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_s16
17f4a2713aSLionel Sambuc return vext_s16(a, b, 3);
18*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}}
19f4a2713aSLionel Sambuc }
20f4a2713aSLionel Sambuc
test_vext_s32(int32x2_t a,int32x2_t b)21f4a2713aSLionel Sambuc int32x2_t test_vext_s32(int32x2_t a, int32x2_t b) {
22*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_s32
23f4a2713aSLionel Sambuc return vext_s32(a, b, 1);
24*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}}
25f4a2713aSLionel Sambuc }
26f4a2713aSLionel Sambuc
test_vext_s64(int64x1_t a,int64x1_t b)27f4a2713aSLionel Sambuc int64x1_t test_vext_s64(int64x1_t a, int64x1_t b) {
28*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_s64
29f4a2713aSLionel Sambuc return vext_s64(a, b, 0);
30f4a2713aSLionel Sambuc }
31f4a2713aSLionel Sambuc
test_vextq_s8(int8x16_t a,int8x16_t b)32f4a2713aSLionel Sambuc int8x16_t test_vextq_s8(int8x16_t a, int8x16_t b) {
33*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_s8
34f4a2713aSLionel Sambuc return vextq_s8(a, b, 2);
35*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}}
36f4a2713aSLionel Sambuc }
37f4a2713aSLionel Sambuc
test_vextq_s16(int16x8_t a,int16x8_t b)38f4a2713aSLionel Sambuc int16x8_t test_vextq_s16(int16x8_t a, int16x8_t b) {
39*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_s16
40f4a2713aSLionel Sambuc return vextq_s16(a, b, 3);
41*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}}
42f4a2713aSLionel Sambuc }
43f4a2713aSLionel Sambuc
test_vextq_s32(int32x4_t a,int32x4_t b)44f4a2713aSLionel Sambuc int32x4_t test_vextq_s32(int32x4_t a, int32x4_t b) {
45*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_s32
46f4a2713aSLionel Sambuc return vextq_s32(a, b, 1);
47*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}}
48f4a2713aSLionel Sambuc }
49f4a2713aSLionel Sambuc
test_vextq_s64(int64x2_t a,int64x2_t b)50f4a2713aSLionel Sambuc int64x2_t test_vextq_s64(int64x2_t a, int64x2_t b) {
51*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_s64
52f4a2713aSLionel Sambuc return vextq_s64(a, b, 1);
53*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}}
54f4a2713aSLionel Sambuc }
55f4a2713aSLionel Sambuc
test_vext_u8(uint8x8_t a,uint8x8_t b)56f4a2713aSLionel Sambuc uint8x8_t test_vext_u8(uint8x8_t a, uint8x8_t b) {
57*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_u8
58f4a2713aSLionel Sambuc return vext_u8(a, b, 2);
59*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}}
60f4a2713aSLionel Sambuc }
61f4a2713aSLionel Sambuc
test_vext_u16(uint16x4_t a,uint16x4_t b)62f4a2713aSLionel Sambuc uint16x4_t test_vext_u16(uint16x4_t a, uint16x4_t b) {
63*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_u16
64f4a2713aSLionel Sambuc return vext_u16(a, b, 3);
65*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}}
66f4a2713aSLionel Sambuc }
67f4a2713aSLionel Sambuc
test_vext_u32(uint32x2_t a,uint32x2_t b)68f4a2713aSLionel Sambuc uint32x2_t test_vext_u32(uint32x2_t a, uint32x2_t b) {
69*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_u32
70f4a2713aSLionel Sambuc return vext_u32(a, b, 1);
71*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}}
72f4a2713aSLionel Sambuc }
73f4a2713aSLionel Sambuc
test_vext_u64(uint64x1_t a,uint64x1_t b)74f4a2713aSLionel Sambuc uint64x1_t test_vext_u64(uint64x1_t a, uint64x1_t b) {
75*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_u64
76f4a2713aSLionel Sambuc return vext_u64(a, b, 0);
77f4a2713aSLionel Sambuc }
78f4a2713aSLionel Sambuc
test_vextq_u8(uint8x16_t a,uint8x16_t b)79f4a2713aSLionel Sambuc uint8x16_t test_vextq_u8(uint8x16_t a, uint8x16_t b) {
80*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_u8
81f4a2713aSLionel Sambuc return vextq_u8(a, b, 2);
82*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}}
83f4a2713aSLionel Sambuc }
84f4a2713aSLionel Sambuc
test_vextq_u16(uint16x8_t a,uint16x8_t b)85f4a2713aSLionel Sambuc uint16x8_t test_vextq_u16(uint16x8_t a, uint16x8_t b) {
86*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_u16
87f4a2713aSLionel Sambuc return vextq_u16(a, b, 3);
88*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}}
89f4a2713aSLionel Sambuc }
90f4a2713aSLionel Sambuc
test_vextq_u32(uint32x4_t a,uint32x4_t b)91f4a2713aSLionel Sambuc uint32x4_t test_vextq_u32(uint32x4_t a, uint32x4_t b) {
92*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_u32
93f4a2713aSLionel Sambuc return vextq_u32(a, b, 1);
94*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}}
95f4a2713aSLionel Sambuc }
96f4a2713aSLionel Sambuc
test_vextq_u64(uint64x2_t a,uint64x2_t b)97f4a2713aSLionel Sambuc uint64x2_t test_vextq_u64(uint64x2_t a, uint64x2_t b) {
98*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_u64
99f4a2713aSLionel Sambuc return vextq_u64(a, b, 1);
100*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}}
101f4a2713aSLionel Sambuc }
102f4a2713aSLionel Sambuc
test_vext_f32(float32x2_t a,float32x2_t b)103f4a2713aSLionel Sambuc float32x2_t test_vext_f32(float32x2_t a, float32x2_t b) {
104*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_f32
105f4a2713aSLionel Sambuc return vext_f32(a, b, 1);
106*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}}
107f4a2713aSLionel Sambuc }
108f4a2713aSLionel Sambuc
test_vext_f64(float64x1_t a,float64x1_t b)109f4a2713aSLionel Sambuc float64x1_t test_vext_f64(float64x1_t a, float64x1_t b) {
110*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_f64
111f4a2713aSLionel Sambuc return vext_f64(a, b, 0);
112f4a2713aSLionel Sambuc }
113f4a2713aSLionel Sambuc
test_vextq_f32(float32x4_t a,float32x4_t b)114f4a2713aSLionel Sambuc float32x4_t test_vextq_f32(float32x4_t a, float32x4_t b) {
115*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_f32
116f4a2713aSLionel Sambuc return vextq_f32(a, b, 1);
117*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}}
118f4a2713aSLionel Sambuc }
119f4a2713aSLionel Sambuc
test_vextq_f64(float64x2_t a,float64x2_t b)120f4a2713aSLionel Sambuc float64x2_t test_vextq_f64(float64x2_t a, float64x2_t b) {
121*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_f64
122f4a2713aSLionel Sambuc return vextq_f64(a, b, 1);
123*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}}
124f4a2713aSLionel Sambuc }
125f4a2713aSLionel Sambuc
test_vext_p8(poly8x8_t a,poly8x8_t b)126f4a2713aSLionel Sambuc poly8x8_t test_vext_p8(poly8x8_t a, poly8x8_t b) {
127*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_p8
128f4a2713aSLionel Sambuc return vext_p8(a, b, 2);
129*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}}
130f4a2713aSLionel Sambuc }
131f4a2713aSLionel Sambuc
test_vext_p16(poly16x4_t a,poly16x4_t b)132f4a2713aSLionel Sambuc poly16x4_t test_vext_p16(poly16x4_t a, poly16x4_t b) {
133*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vext_p16
134f4a2713aSLionel Sambuc return vext_p16(a, b, 3);
135*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}}
136f4a2713aSLionel Sambuc }
137f4a2713aSLionel Sambuc
test_vextq_p8(poly8x16_t a,poly8x16_t b)138f4a2713aSLionel Sambuc poly8x16_t test_vextq_p8(poly8x16_t a, poly8x16_t b) {
139*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_p8
140f4a2713aSLionel Sambuc return vextq_p8(a, b, 2);
141*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}}
142f4a2713aSLionel Sambuc }
143f4a2713aSLionel Sambuc
test_vextq_p16(poly16x8_t a,poly16x8_t b)144f4a2713aSLionel Sambuc poly16x8_t test_vextq_p16(poly16x8_t a, poly16x8_t b) {
145*0a6a1f1dSLionel Sambuc // CHECK-LABEL: test_vextq_p16
146f4a2713aSLionel Sambuc return vextq_p16(a, b, 3);
147*0a6a1f1dSLionel Sambuc // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}}
148f4a2713aSLionel Sambuc }
149