1 // RUN: %clang_cc1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s
3 // Test ARM64 extract intrinsics
4 // can use as back end test by adding a run line with
5 // -check-prefix=CHECK-CODEGEN on the FileCheck
11 // CHECK: test_vext_s8
13 xS8x8 = vext_s8(xS8x8, xS8x8, 1);
14 // CHECK: shufflevector
15 // CHECK-CODEGEN: test_vext_s8:
16 // CHECK-CODEGEN: {{ext.8.*#1}}
21 // CHECK: test_vext_u8
23 xU8x8 = vext_u8(xU8x8, xU8x8, 2);
24 // CHECK: shufflevector
25 // CHECK-CODEGEN: test_vext_u8:
26 // CHECK-CODEGEN: {{ext.8.*#2}}
31 // CHECK: test_vext_p8
33 xP8x8 = vext_p8(xP8x8, xP8x8, 3);
34 // CHECK: shufflevector
35 // CHECK-CODEGEN: test_vext_p8:
36 // CHECK-CODEGEN: {{ext.8.*#3}}
41 // CHECK: test_vext_s16
43 xS16x4 = vext_s16(xS16x4, xS16x4, 1);
44 // CHECK: shufflevector
45 // CHECK-CODEGEN: test_vext_s16:
46 // CHECK-CODEGEN: {{ext.8.*#2}}
51 // CHECK: test_vext_u16
53 xU16x4 = vext_u16(xU16x4, xU16x4, 2);
54 // CHECK: shufflevector
55 // CHECK-CODEGEN: test_vext_u16:
56 // CHECK-CODEGEN: {{ext.8.*#4}}
61 // CHECK: test_vext_p16
63 xP16x4 = vext_p16(xP16x4, xP16x4, 3);
64 // CHECK: shufflevector
65 // CHECK-CODEGEN: test_vext_p16:
66 // CHECK-CODEGEN: {{ext.8.*#6}}
71 // CHECK: test_vext_s32
73 xS32x2 = vext_s32(xS32x2, xS32x2, 1);
74 // CHECK: shufflevector
75 // CHECK-CODEGEN: test_vext_s32:
76 // CHECK-CODEGEN: {{ext.8.*#4}}
81 // CHECK: test_vext_u32
83 xU32x2 = vext_u32(xU32x2, xU32x2, 1);
84 // CHECK: shufflevector
85 // CHECK-CODEGEN: test_vext_u32:
86 // CHECK-CODEGEN: {{ext.8.*#4}}
91 // CHECK: test_vext_f32
93 xF32x2 = vext_f32(xF32x2, xF32x2, 1);
94 // CHECK: shufflevector
95 // CHECK-CODEGEN: test_vext_f32:
96 // CHECK-CODEGEN: {{ext.8.*#4}}
101 // CHECK: test_vext_s64
103 // FIXME don't use 1 as index or check for now, clang has a bug?
104 xS64x1 = vext_s64(xS64x1, xS64x1, /*1*/0);
105 // CHECK: shufflevector
106 // CHECK-CODEGEN: test_vext_s64:
107 // CHECK_FIXME: {{ext.8.*#0}}
112 // CHECK: test_vext_u64
114 // FIXME don't use 1 as index or check for now, clang has a bug?
115 xU64x1 = vext_u64(xU64x1, xU64x1, /*1*/0);
116 // CHECK: shufflevector
117 // CHECK-CODEGEN: test_vext_u64:
118 // CHECK_FIXME: {{ext.8.*#0}}
123 // CHECK: test_vextq_s8
125 xS8x16 = vextq_s8(xS8x16, xS8x16, 4);
126 // CHECK: shufflevector
127 // CHECK-CODEGEN: test_vextq_s8:
128 // CHECK-CODEGEN: {{ext.16.*#4}}
133 // CHECK: test_vextq_u8
135 xU8x16 = vextq_u8(xU8x16, xU8x16, 5);
136 // CHECK: shufflevector
137 // CHECK-CODEGEN: test_vextq_u8:
138 // CHECK-CODEGEN: {{ext.16.*#5}}
143 // CHECK: test_vextq_p8
145 xP8x16 = vextq_p8(xP8x16, xP8x16, 6);
146 // CHECK: shufflevector
147 // CHECK-CODEGEN: test_vextq_p8:
148 // CHECK-CODEGEN: {{ext.16.*#6}}
151 void test_vextq_s16()
153 // CHECK: test_vextq_s16
155 xS16x8 = vextq_s16(xS16x8, xS16x8, 7);
156 // CHECK: shufflevector
157 // CHECK-CODEGEN: test_vextq_s16:
158 // CHECK-CODEGEN: {{ext.16.*#14}}
161 void test_vextq_u16()
163 // CHECK: test_vextq_u16
165 xU16x8 = vextq_u16(xU16x8, xU16x8, 4);
166 // CHECK: shufflevector
167 // CHECK-CODEGEN: test_vextq_u16:
168 // CHECK-CODEGEN: {{ext.16.*#8}}
171 void test_vextq_p16()
173 // CHECK: test_vextq_p16
175 xP16x8 = vextq_p16(xP16x8, xP16x8, 5);
176 // CHECK: shufflevector
177 // CHECK-CODEGEN: test_vextq_p16:
178 // CHECK-CODEGEN: {{ext.16.*#10}}
181 void test_vextq_s32()
183 // CHECK: test_vextq_s32
185 xS32x4 = vextq_s32(xS32x4, xS32x4, 1);
186 // CHECK: shufflevector
187 // CHECK-CODEGEN: test_vextq_s32:
188 // CHECK-CODEGEN: {{ext.16.*#4}}
191 void test_vextq_u32()
193 // CHECK: test_vextq_u32
195 xU32x4 = vextq_u32(xU32x4, xU32x4, 2);
196 // CHECK: shufflevector
197 // CHECK-CODEGEN: test_vextq_u32:
198 // CHECK-CODEGEN: {{ext.16.*#8}}
201 void test_vextq_f32()
203 // CHECK: test_vextq_f32
205 xF32x4 = vextq_f32(xF32x4, xF32x4, 3);
206 // CHECK: shufflevector
207 // CHECK-CODEGEN: test_vextq_f32:
208 // CHECK-CODEGEN: {{ext.16.*#12}}
211 void test_vextq_s64()
213 // CHECK: test_vextq_s64
215 xS64x2 = vextq_s64(xS64x2, xS64x2, 1);
216 // CHECK: shufflevector
217 // CHECK-CODEGEN: test_vextq_s64:
218 // CHECK-CODEGEN: {{ext.16.*#8}}
221 void test_vextq_u64()
223 // CHECK: test_vextq_u64
225 xU64x2 = vextq_u64(xU64x2, xU64x2, 1);
226 // CHECK: shufflevector
227 // CHECK-CODEGEN: test_vextq_u64:
228 // CHECK-CODEGEN: {{ext.16.*#8}}
231 void test_vextq_f64()
233 // CHECK: test_vextq_f64
235 xF64x2 = vextq_f64(xF64x2, xF64x2, 1);
236 // CHECK: shufflevector
237 // CHECK-CODEGEN: test_vextq_u64:
238 // CHECK-CODEGEN: {{ext.16.*#8}}