1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve.fp -verify-machineinstrs %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <4 x i32> @sext_v4i1_v4i32(<4 x i32> %src) {
5 ; CHECK-LABEL: sext_v4i1_v4i32:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vmov.i32 q1, #0x0
8 ; CHECK-NEXT: vmov.i8 q2, #0xff
9 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
10 ; CHECK-NEXT: vpsel q0, q2, q1
13 %c = icmp sgt <4 x i32> %src, zeroinitializer
14 %0 = sext <4 x i1> %c to <4 x i32>
18 define arm_aapcs_vfpcc <8 x i16> @sext_v8i1_v8i16(<8 x i16> %src) {
19 ; CHECK-LABEL: sext_v8i1_v8i16:
20 ; CHECK: @ %bb.0: @ %entry
21 ; CHECK-NEXT: vmov.i16 q1, #0x0
22 ; CHECK-NEXT: vmov.i8 q2, #0xff
23 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
24 ; CHECK-NEXT: vpsel q0, q2, q1
27 %c = icmp sgt <8 x i16> %src, zeroinitializer
28 %0 = sext <8 x i1> %c to <8 x i16>
32 define arm_aapcs_vfpcc <16 x i8> @sext_v16i1_v16i8(<16 x i8> %src) {
33 ; CHECK-LABEL: sext_v16i1_v16i8:
34 ; CHECK: @ %bb.0: @ %entry
35 ; CHECK-NEXT: vmov.i8 q1, #0x0
36 ; CHECK-NEXT: vmov.i8 q2, #0xff
37 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
38 ; CHECK-NEXT: vpsel q0, q2, q1
41 %c = icmp sgt <16 x i8> %src, zeroinitializer
42 %0 = sext <16 x i1> %c to <16 x i8>
46 define arm_aapcs_vfpcc <2 x i64> @sext_v2i1_v2i64(<2 x i64> %src) {
47 ; CHECK-LABEL: sext_v2i1_v2i64:
48 ; CHECK: @ %bb.0: @ %entry
49 ; CHECK-NEXT: vmov r1, s2
50 ; CHECK-NEXT: movs r2, #0
51 ; CHECK-NEXT: vmov r0, s3
52 ; CHECK-NEXT: vmov r3, s0
53 ; CHECK-NEXT: rsbs r1, r1, #0
54 ; CHECK-NEXT: vmov r1, s1
55 ; CHECK-NEXT: sbcs.w r0, r2, r0
56 ; CHECK-NEXT: mov.w r0, #0
58 ; CHECK-NEXT: movlt r0, #1
59 ; CHECK-NEXT: cmp r0, #0
60 ; CHECK-NEXT: csetm r0, ne
61 ; CHECK-NEXT: rsbs r3, r3, #0
62 ; CHECK-NEXT: sbcs.w r1, r2, r1
64 ; CHECK-NEXT: movlt r2, #1
65 ; CHECK-NEXT: cmp r2, #0
66 ; CHECK-NEXT: csetm r1, ne
67 ; CHECK-NEXT: vmov.32 q0[0], r1
68 ; CHECK-NEXT: vmov.32 q0[1], r1
69 ; CHECK-NEXT: vmov.32 q0[2], r0
70 ; CHECK-NEXT: vmov.32 q0[3], r0
73 %c = icmp sgt <2 x i64> %src, zeroinitializer
74 %0 = sext <2 x i1> %c to <2 x i64>
79 define arm_aapcs_vfpcc <4 x i32> @zext_v4i1_v4i32(<4 x i32> %src) {
80 ; CHECK-LABEL: zext_v4i1_v4i32:
81 ; CHECK: @ %bb.0: @ %entry
82 ; CHECK-NEXT: vmov.i32 q1, #0x0
83 ; CHECK-NEXT: vmov.i32 q2, #0x1
84 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
85 ; CHECK-NEXT: vpsel q0, q2, q1
88 %c = icmp sgt <4 x i32> %src, zeroinitializer
89 %0 = zext <4 x i1> %c to <4 x i32>
93 define arm_aapcs_vfpcc <8 x i16> @zext_v8i1_v8i16(<8 x i16> %src) {
94 ; CHECK-LABEL: zext_v8i1_v8i16:
95 ; CHECK: @ %bb.0: @ %entry
96 ; CHECK-NEXT: vmov.i16 q1, #0x0
97 ; CHECK-NEXT: vmov.i16 q2, #0x1
98 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
99 ; CHECK-NEXT: vpsel q0, q2, q1
102 %c = icmp sgt <8 x i16> %src, zeroinitializer
103 %0 = zext <8 x i1> %c to <8 x i16>
107 define arm_aapcs_vfpcc <16 x i8> @zext_v16i1_v16i8(<16 x i8> %src) {
108 ; CHECK-LABEL: zext_v16i1_v16i8:
109 ; CHECK: @ %bb.0: @ %entry
110 ; CHECK-NEXT: vmov.i8 q1, #0x0
111 ; CHECK-NEXT: vmov.i8 q2, #0x1
112 ; CHECK-NEXT: vcmp.s8 gt, q0, zr
113 ; CHECK-NEXT: vpsel q0, q2, q1
116 %c = icmp sgt <16 x i8> %src, zeroinitializer
117 %0 = zext <16 x i1> %c to <16 x i8>
121 define arm_aapcs_vfpcc <2 x i64> @zext_v2i1_v2i64(<2 x i64> %src) {
122 ; CHECK-LABEL: zext_v2i1_v2i64:
123 ; CHECK: @ %bb.0: @ %entry
124 ; CHECK-NEXT: vmov r2, s2
125 ; CHECK-NEXT: adr r1, .LCPI7_0
126 ; CHECK-NEXT: vldrw.u32 q1, [r1]
127 ; CHECK-NEXT: vmov r1, s3
128 ; CHECK-NEXT: vmov r3, s0
129 ; CHECK-NEXT: movs r0, #0
130 ; CHECK-NEXT: rsbs r2, r2, #0
131 ; CHECK-NEXT: vmov r2, s1
132 ; CHECK-NEXT: sbcs.w r1, r0, r1
133 ; CHECK-NEXT: mov.w r1, #0
135 ; CHECK-NEXT: movlt r1, #1
136 ; CHECK-NEXT: cmp r1, #0
137 ; CHECK-NEXT: csetm r1, ne
138 ; CHECK-NEXT: rsbs r3, r3, #0
139 ; CHECK-NEXT: sbcs.w r2, r0, r2
141 ; CHECK-NEXT: movlt r0, #1
142 ; CHECK-NEXT: cmp r0, #0
143 ; CHECK-NEXT: csetm r0, ne
144 ; CHECK-NEXT: vmov.32 q0[0], r0
145 ; CHECK-NEXT: vmov.32 q0[2], r1
146 ; CHECK-NEXT: vand q0, q0, q1
148 ; CHECK-NEXT: .p2align 4
149 ; CHECK-NEXT: @ %bb.1:
150 ; CHECK-NEXT: .LCPI7_0:
151 ; CHECK-NEXT: .long 1 @ 0x1
152 ; CHECK-NEXT: .long 0 @ 0x0
153 ; CHECK-NEXT: .long 1 @ 0x1
154 ; CHECK-NEXT: .long 0 @ 0x0
156 %c = icmp sgt <2 x i64> %src, zeroinitializer
157 %0 = zext <2 x i1> %c to <2 x i64>
162 define arm_aapcs_vfpcc <4 x i32> @trunc_v4i1_v4i32(<4 x i32> %src) {
163 ; CHECK-LABEL: trunc_v4i1_v4i32:
164 ; CHECK: @ %bb.0: @ %entry
165 ; CHECK-NEXT: vmov.i32 q1, #0x0
166 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
167 ; CHECK-NEXT: vpsel q0, q0, q1
170 %0 = trunc <4 x i32> %src to <4 x i1>
171 %1 = select <4 x i1> %0, <4 x i32> %src, <4 x i32> zeroinitializer
175 define arm_aapcs_vfpcc <8 x i16> @trunc_v8i1_v8i16(<8 x i16> %src) {
176 ; CHECK-LABEL: trunc_v8i1_v8i16:
177 ; CHECK: @ %bb.0: @ %entry
178 ; CHECK-NEXT: vmov.i32 q1, #0x0
179 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
180 ; CHECK-NEXT: vpsel q0, q0, q1
183 %0 = trunc <8 x i16> %src to <8 x i1>
184 %1 = select <8 x i1> %0, <8 x i16> %src, <8 x i16> zeroinitializer
188 define arm_aapcs_vfpcc <16 x i8> @trunc_v16i1_v16i8(<16 x i8> %src) {
189 ; CHECK-LABEL: trunc_v16i1_v16i8:
190 ; CHECK: @ %bb.0: @ %entry
191 ; CHECK-NEXT: vmov.i32 q1, #0x0
192 ; CHECK-NEXT: vcmp.i32 ne, q0, zr
193 ; CHECK-NEXT: vpsel q0, q0, q1
196 %0 = trunc <16 x i8> %src to <16 x i1>
197 %1 = select <16 x i1> %0, <16 x i8> %src, <16 x i8> zeroinitializer
201 define arm_aapcs_vfpcc <2 x i64> @trunc_v2i1_v2i64(<2 x i64> %src) {
202 ; CHECK-LABEL: trunc_v2i1_v2i64:
203 ; CHECK: @ %bb.0: @ %entry
204 ; CHECK-NEXT: vmov r1, s0
205 ; CHECK-NEXT: vmov r0, s2
206 ; CHECK-NEXT: and r1, r1, #1
207 ; CHECK-NEXT: rsbs r1, r1, #0
208 ; CHECK-NEXT: and r0, r0, #1
209 ; CHECK-NEXT: vmov.32 q1[0], r1
210 ; CHECK-NEXT: rsbs r0, r0, #0
211 ; CHECK-NEXT: vmov.32 q1[1], r1
212 ; CHECK-NEXT: vmov.32 q1[2], r0
213 ; CHECK-NEXT: vmov.32 q1[3], r0
214 ; CHECK-NEXT: vand q0, q0, q1
217 %0 = trunc <2 x i64> %src to <2 x i1>
218 %1 = select <2 x i1> %0, <2 x i64> %src, <2 x i64> zeroinitializer
223 define arm_aapcs_vfpcc <4 x float> @uitofp_v4i1_v4f32(<4 x i32> %src) {
224 ; CHECK-LABEL: uitofp_v4i1_v4f32:
225 ; CHECK: @ %bb.0: @ %entry
226 ; CHECK-NEXT: vmov.i32 q1, #0x0
227 ; CHECK-NEXT: vmov.f32 q2, #1.000000e+00
228 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
229 ; CHECK-NEXT: vpsel q0, q2, q1
232 %c = icmp sgt <4 x i32> %src, zeroinitializer
233 %0 = uitofp <4 x i1> %c to <4 x float>
237 define arm_aapcs_vfpcc <4 x float> @sitofp_v4i1_v4f32(<4 x i32> %src) {
238 ; CHECK-LABEL: sitofp_v4i1_v4f32:
239 ; CHECK: @ %bb.0: @ %entry
240 ; CHECK-NEXT: vmov.i32 q1, #0x0
241 ; CHECK-NEXT: vmov.f32 q2, #-1.000000e+00
242 ; CHECK-NEXT: vcmp.s32 gt, q0, zr
243 ; CHECK-NEXT: vpsel q0, q2, q1
246 %c = icmp sgt <4 x i32> %src, zeroinitializer
247 %0 = sitofp <4 x i1> %c to <4 x float>
251 define arm_aapcs_vfpcc <4 x float> @fptoui_v4i1_v4f32(<4 x float> %src) {
252 ; CHECK-LABEL: fptoui_v4i1_v4f32:
253 ; CHECK: @ %bb.0: @ %entry
254 ; CHECK-NEXT: vmov.i32 q1, #0x0
255 ; CHECK-NEXT: vmov.f32 q2, #1.000000e+00
256 ; CHECK-NEXT: vcmp.f32 ne, q0, zr
257 ; CHECK-NEXT: vpsel q0, q2, q1
260 %0 = fptoui <4 x float> %src to <4 x i1>
261 %s = select <4 x i1> %0, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float> zeroinitializer
265 define arm_aapcs_vfpcc <4 x float> @fptosi_v4i1_v4f32(<4 x float> %src) {
266 ; CHECK-LABEL: fptosi_v4i1_v4f32:
267 ; CHECK: @ %bb.0: @ %entry
268 ; CHECK-NEXT: vmov.i32 q1, #0x0
269 ; CHECK-NEXT: vmov.f32 q2, #1.000000e+00
270 ; CHECK-NEXT: vcmp.f32 ne, q0, zr
271 ; CHECK-NEXT: vpsel q0, q2, q1
274 %0 = fptosi <4 x float> %src to <4 x i1>
275 %s = select <4 x i1> %0, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float> zeroinitializer
281 define arm_aapcs_vfpcc <8 x half> @uitofp_v8i1_v8f16(<8 x i16> %src) {
282 ; CHECK-LABEL: uitofp_v8i1_v8f16:
283 ; CHECK: @ %bb.0: @ %entry
284 ; CHECK-NEXT: vmov.i16 q1, #0x0
285 ; CHECK-NEXT: vmov.i16 q2, #0x3c00
286 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
287 ; CHECK-NEXT: vpsel q0, q2, q1
290 %c = icmp sgt <8 x i16> %src, zeroinitializer
291 %0 = uitofp <8 x i1> %c to <8 x half>
295 define arm_aapcs_vfpcc <8 x half> @sitofp_v8i1_v8f16(<8 x i16> %src) {
296 ; CHECK-LABEL: sitofp_v8i1_v8f16:
297 ; CHECK: @ %bb.0: @ %entry
298 ; CHECK-NEXT: vmov.i16 q1, #0x0
299 ; CHECK-NEXT: vmov.i16 q2, #0xbc00
300 ; CHECK-NEXT: vcmp.s16 gt, q0, zr
301 ; CHECK-NEXT: vpsel q0, q2, q1
304 %c = icmp sgt <8 x i16> %src, zeroinitializer
305 %0 = sitofp <8 x i1> %c to <8 x half>
309 define arm_aapcs_vfpcc <8 x half> @fptoui_v8i1_v8f16(<8 x half> %src) {
310 ; CHECK-LABEL: fptoui_v8i1_v8f16:
311 ; CHECK: @ %bb.0: @ %entry
312 ; CHECK-NEXT: vmov.i32 q1, #0x0
313 ; CHECK-NEXT: vmov.i16 q2, #0x3c00
314 ; CHECK-NEXT: vcmp.f16 ne, q0, zr
315 ; CHECK-NEXT: vpsel q0, q2, q1
318 %0 = fptoui <8 x half> %src to <8 x i1>
319 %s = select <8 x i1> %0, <8 x half> <half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0>, <8 x half> zeroinitializer
323 define arm_aapcs_vfpcc <8 x half> @fptosi_v8i1_v8f16(<8 x half> %src) {
324 ; CHECK-LABEL: fptosi_v8i1_v8f16:
325 ; CHECK: @ %bb.0: @ %entry
326 ; CHECK-NEXT: vmov.i32 q1, #0x0
327 ; CHECK-NEXT: vmov.i16 q2, #0x3c00
328 ; CHECK-NEXT: vcmp.f16 ne, q0, zr
329 ; CHECK-NEXT: vpsel q0, q2, q1
332 %0 = fptosi <8 x half> %src to <8 x i1>
333 %s = select <8 x i1> %0, <8 x half> <half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0>, <8 x half> zeroinitializer