1 ; RUN: llc < %s -mtriple=arm64-eabi -aarch64-neon-syntax=apple | FileCheck %s
3 define <8 x i8> @xtn8b(<8 x i16> %A) nounwind {
8 %tmp3 = trunc <8 x i16> %A to <8 x i8>
12 define <4 x i16> @xtn4h(<4 x i32> %A) nounwind {
17 %tmp3 = trunc <4 x i32> %A to <4 x i16>
21 define <2 x i32> @xtn2s(<2 x i64> %A) nounwind {
26 %tmp3 = trunc <2 x i64> %A to <2 x i32>
30 define <16 x i8> @xtn2_16b(<8 x i8> %ret, <8 x i16> %A) nounwind {
31 ;CHECK-LABEL: xtn2_16b:
33 ;CHECK: xtn2.16b v0, v1
35 %tmp3 = trunc <8 x i16> %A to <8 x i8>
36 %res = shufflevector <8 x i8> %ret, <8 x i8> %tmp3, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
40 define <8 x i16> @xtn2_8h(<4 x i16> %ret, <4 x i32> %A) nounwind {
41 ;CHECK-LABEL: xtn2_8h:
43 ;CHECK: xtn2.8h v0, v1
45 %tmp3 = trunc <4 x i32> %A to <4 x i16>
46 %res = shufflevector <4 x i16> %ret, <4 x i16> %tmp3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
50 define <4 x i32> @xtn2_4s(<2 x i32> %ret, <2 x i64> %A) nounwind {
51 ;CHECK-LABEL: xtn2_4s:
53 ;CHECK: xtn2.4s v0, v1
55 %tmp3 = trunc <2 x i64> %A to <2 x i32>
56 %res = shufflevector <2 x i32> %ret, <2 x i32> %tmp3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
60 define <8 x i8> @sqxtn8b(<8 x i16> %A) nounwind {
61 ;CHECK-LABEL: sqxtn8b:
63 ;CHECK: sqxtn.8b v0, v0
65 %tmp3 = call <8 x i8> @llvm.aarch64.neon.sqxtn.v8i8(<8 x i16> %A)
69 define <4 x i16> @sqxtn4h(<4 x i32> %A) nounwind {
70 ;CHECK-LABEL: sqxtn4h:
72 ;CHECK: sqxtn.4h v0, v0
74 %tmp3 = call <4 x i16> @llvm.aarch64.neon.sqxtn.v4i16(<4 x i32> %A)
78 define <2 x i32> @sqxtn2s(<2 x i64> %A) nounwind {
79 ;CHECK-LABEL: sqxtn2s:
81 ;CHECK: sqxtn.2s v0, v0
83 %tmp3 = call <2 x i32> @llvm.aarch64.neon.sqxtn.v2i32(<2 x i64> %A)
87 define <16 x i8> @sqxtn2_16b(<8 x i8> %ret, <8 x i16> %A) nounwind {
88 ;CHECK-LABEL: sqxtn2_16b:
90 ;CHECK: sqxtn2.16b v0, v1
92 %tmp3 = call <8 x i8> @llvm.aarch64.neon.sqxtn.v8i8(<8 x i16> %A)
93 %res = shufflevector <8 x i8> %ret, <8 x i8> %tmp3, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
97 define <8 x i16> @sqxtn2_8h(<4 x i16> %ret, <4 x i32> %A) nounwind {
98 ;CHECK-LABEL: sqxtn2_8h:
100 ;CHECK: sqxtn2.8h v0, v1
102 %tmp3 = call <4 x i16> @llvm.aarch64.neon.sqxtn.v4i16(<4 x i32> %A)
103 %res = shufflevector <4 x i16> %ret, <4 x i16> %tmp3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
107 define <4 x i32> @sqxtn2_4s(<2 x i32> %ret, <2 x i64> %A) nounwind {
108 ;CHECK-LABEL: sqxtn2_4s:
110 ;CHECK: sqxtn2.4s v0, v1
112 %tmp3 = call <2 x i32> @llvm.aarch64.neon.sqxtn.v2i32(<2 x i64> %A)
113 %res = shufflevector <2 x i32> %ret, <2 x i32> %tmp3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
117 declare <8 x i8> @llvm.aarch64.neon.sqxtn.v8i8(<8 x i16>) nounwind readnone
118 declare <4 x i16> @llvm.aarch64.neon.sqxtn.v4i16(<4 x i32>) nounwind readnone
119 declare <2 x i32> @llvm.aarch64.neon.sqxtn.v2i32(<2 x i64>) nounwind readnone
121 define <8 x i8> @uqxtn8b(<8 x i16> %A) nounwind {
122 ;CHECK-LABEL: uqxtn8b:
124 ;CHECK: uqxtn.8b v0, v0
126 %tmp3 = call <8 x i8> @llvm.aarch64.neon.uqxtn.v8i8(<8 x i16> %A)
130 define <4 x i16> @uqxtn4h(<4 x i32> %A) nounwind {
131 ;CHECK-LABEL: uqxtn4h:
133 ;CHECK: uqxtn.4h v0, v0
135 %tmp3 = call <4 x i16> @llvm.aarch64.neon.uqxtn.v4i16(<4 x i32> %A)
139 define <2 x i32> @uqxtn2s(<2 x i64> %A) nounwind {
140 ;CHECK-LABEL: uqxtn2s:
142 ;CHECK: uqxtn.2s v0, v0
144 %tmp3 = call <2 x i32> @llvm.aarch64.neon.uqxtn.v2i32(<2 x i64> %A)
148 define <16 x i8> @uqxtn2_16b(<8 x i8> %ret, <8 x i16> %A) nounwind {
149 ;CHECK-LABEL: uqxtn2_16b:
151 ;CHECK: uqxtn2.16b v0, v1
153 %tmp3 = call <8 x i8> @llvm.aarch64.neon.uqxtn.v8i8(<8 x i16> %A)
154 %res = shufflevector <8 x i8> %ret, <8 x i8> %tmp3, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
158 define <8 x i16> @uqxtn2_8h(<4 x i16> %ret, <4 x i32> %A) nounwind {
159 ;CHECK-LABEL: uqxtn2_8h:
161 ;CHECK: uqxtn2.8h v0, v1
163 %tmp3 = call <4 x i16> @llvm.aarch64.neon.uqxtn.v4i16(<4 x i32> %A)
164 %res = shufflevector <4 x i16> %ret, <4 x i16> %tmp3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
168 define <4 x i32> @uqxtn2_4s(<2 x i32> %ret, <2 x i64> %A) nounwind {
169 ;CHECK-LABEL: uqxtn2_4s:
171 ;CHECK: uqxtn2.4s v0, v1
173 %tmp3 = call <2 x i32> @llvm.aarch64.neon.uqxtn.v2i32(<2 x i64> %A)
174 %res = shufflevector <2 x i32> %ret, <2 x i32> %tmp3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
178 declare <8 x i8> @llvm.aarch64.neon.uqxtn.v8i8(<8 x i16>) nounwind readnone
179 declare <4 x i16> @llvm.aarch64.neon.uqxtn.v4i16(<4 x i32>) nounwind readnone
180 declare <2 x i32> @llvm.aarch64.neon.uqxtn.v2i32(<2 x i64>) nounwind readnone
182 define <8 x i8> @sqxtun8b(<8 x i16> %A) nounwind {
183 ;CHECK-LABEL: sqxtun8b:
185 ;CHECK: sqxtun.8b v0, v0
187 %tmp3 = call <8 x i8> @llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> %A)
191 define <4 x i16> @sqxtun4h(<4 x i32> %A) nounwind {
192 ;CHECK-LABEL: sqxtun4h:
194 ;CHECK: sqxtun.4h v0, v0
196 %tmp3 = call <4 x i16> @llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> %A)
200 define <2 x i32> @sqxtun2s(<2 x i64> %A) nounwind {
201 ;CHECK-LABEL: sqxtun2s:
203 ;CHECK: sqxtun.2s v0, v0
205 %tmp3 = call <2 x i32> @llvm.aarch64.neon.sqxtun.v2i32(<2 x i64> %A)
209 define <16 x i8> @sqxtun2_16b(<8 x i8> %ret, <8 x i16> %A) nounwind {
210 ;CHECK-LABEL: sqxtun2_16b:
212 ;CHECK: sqxtun2.16b v0, v1
214 %tmp3 = call <8 x i8> @llvm.aarch64.neon.sqxtun.v8i8(<8 x i16> %A)
215 %res = shufflevector <8 x i8> %ret, <8 x i8> %tmp3, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
219 define <8 x i16> @sqxtun2_8h(<4 x i16> %ret, <4 x i32> %A) nounwind {
220 ;CHECK-LABEL: sqxtun2_8h:
222 ;CHECK: sqxtun2.8h v0, v1
224 %tmp3 = call <4 x i16> @llvm.aarch64.neon.sqxtun.v4i16(<4 x i32> %A)
225 %res = shufflevector <4 x i16> %ret, <4 x i16> %tmp3, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
229 define <4 x i32> @sqxtun2_4s(<2 x i32> %ret, <2 x i64> %A) nounwind {
230 ;CHECK-LABEL: sqxtun2_4s:
232 ;CHECK: sqxtun2.4s v0, v1
234 %tmp3 = call <2 x i32> @llvm.aarch64.neon.sqxtun.v2i32(<2 x i64> %A)
235 %res = shufflevector <2 x i32> %ret, <2 x i32> %tmp3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
239 declare <8 x i8> @llvm.aarch64.neon.sqxtun.v8i8(<8 x i16>) nounwind readnone
240 declare <4 x i16> @llvm.aarch64.neon.sqxtun.v4i16(<4 x i32>) nounwind readnone
241 declare <2 x i32> @llvm.aarch64.neon.sqxtun.v2i32(<2 x i64>) nounwind readnone