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 -verify-machineinstrs %s -o - | FileCheck %s
5 define arm_aapcs_vfpcc <4 x i32> @build_var0_v4i1(i32 %s, i32 %t, <4 x i32> %a, <4 x i32> %b) {
6 ; CHECK-LABEL: build_var0_v4i1:
7 ; CHECK: @ %bb.0: @ %entry
8 ; CHECK-NEXT: cmp r0, r1
9 ; CHECK-NEXT: mov.w r1, #0
10 ; CHECK-NEXT: cset r0, lo
11 ; CHECK-NEXT: and r0, r0, #1
12 ; CHECK-NEXT: rsbs r0, r0, #0
13 ; CHECK-NEXT: bfi r1, r0, #0, #4
14 ; CHECK-NEXT: vmsr p0, r1
15 ; CHECK-NEXT: vpsel q0, q0, q1
18 %c = icmp ult i32 %s, %t
19 %vc = insertelement <4 x i1> zeroinitializer, i1 %c, i64 0
20 %r = select <4 x i1> %vc, <4 x i32> %a, <4 x i32> %b
24 define arm_aapcs_vfpcc <4 x i32> @build_var3_v4i1(i32 %s, i32 %t, <4 x i32> %a, <4 x i32> %b) {
25 ; CHECK-LABEL: build_var3_v4i1:
26 ; CHECK: @ %bb.0: @ %entry
27 ; CHECK-NEXT: cmp r0, r1
28 ; CHECK-NEXT: mov.w r1, #0
29 ; CHECK-NEXT: cset r0, lo
30 ; CHECK-NEXT: and r0, r0, #1
31 ; CHECK-NEXT: rsbs r0, r0, #0
32 ; CHECK-NEXT: bfi r1, r0, #12, #4
33 ; CHECK-NEXT: vmsr p0, r1
34 ; CHECK-NEXT: vpsel q0, q0, q1
37 %c = icmp ult i32 %s, %t
38 %vc = insertelement <4 x i1> zeroinitializer, i1 %c, i64 3
39 %r = select <4 x i1> %vc, <4 x i32> %a, <4 x i32> %b
43 define arm_aapcs_vfpcc <4 x i32> @build_varN_v4i1(i32 %s, i32 %t, <4 x i32> %a, <4 x i32> %b) {
44 ; CHECK-LABEL: build_varN_v4i1:
45 ; CHECK: @ %bb.0: @ %entry
46 ; CHECK-NEXT: cmp r0, r1
47 ; CHECK-NEXT: cset r0, lo
48 ; CHECK-NEXT: and r0, r0, #1
49 ; CHECK-NEXT: rsbs r0, r0, #0
50 ; CHECK-NEXT: vmsr p0, r0
51 ; CHECK-NEXT: vpsel q0, q0, q1
54 %c = icmp ult i32 %s, %t
55 %vc1 = insertelement <4 x i1> undef, i1 %c, i64 0
56 %vc4 = shufflevector <4 x i1> %vc1, <4 x i1> undef, <4 x i32> zeroinitializer
57 %r = select <4 x i1> %vc4, <4 x i32> %a, <4 x i32> %b
62 define arm_aapcs_vfpcc <8 x i16> @build_var0_v8i1(i32 %s, i32 %t, <8 x i16> %a, <8 x i16> %b) {
63 ; CHECK-LABEL: build_var0_v8i1:
64 ; CHECK: @ %bb.0: @ %entry
65 ; CHECK-NEXT: cmp r0, r1
66 ; CHECK-NEXT: mov.w r1, #0
67 ; CHECK-NEXT: cset r0, lo
68 ; CHECK-NEXT: and r0, r0, #1
69 ; CHECK-NEXT: rsbs r0, r0, #0
70 ; CHECK-NEXT: bfi r1, r0, #0, #2
71 ; CHECK-NEXT: vmsr p0, r1
72 ; CHECK-NEXT: vpsel q0, q0, q1
75 %c = icmp ult i32 %s, %t
76 %vc = insertelement <8 x i1> zeroinitializer, i1 %c, i64 0
77 %r = select <8 x i1> %vc, <8 x i16> %a, <8 x i16> %b
81 define arm_aapcs_vfpcc <8 x i16> @build_var3_v8i1(i32 %s, i32 %t, <8 x i16> %a, <8 x i16> %b) {
82 ; CHECK-LABEL: build_var3_v8i1:
83 ; CHECK: @ %bb.0: @ %entry
84 ; CHECK-NEXT: cmp r0, r1
85 ; CHECK-NEXT: mov.w r1, #0
86 ; CHECK-NEXT: cset r0, lo
87 ; CHECK-NEXT: and r0, r0, #1
88 ; CHECK-NEXT: rsbs r0, r0, #0
89 ; CHECK-NEXT: bfi r1, r0, #6, #2
90 ; CHECK-NEXT: vmsr p0, r1
91 ; CHECK-NEXT: vpsel q0, q0, q1
94 %c = icmp ult i32 %s, %t
95 %vc = insertelement <8 x i1> zeroinitializer, i1 %c, i64 3
96 %r = select <8 x i1> %vc, <8 x i16> %a, <8 x i16> %b
100 define arm_aapcs_vfpcc <8 x i16> @build_varN_v8i1(i32 %s, i32 %t, <8 x i16> %a, <8 x i16> %b) {
101 ; CHECK-LABEL: build_varN_v8i1:
102 ; CHECK: @ %bb.0: @ %entry
103 ; CHECK-NEXT: cmp r0, r1
104 ; CHECK-NEXT: cset r0, lo
105 ; CHECK-NEXT: and r0, r0, #1
106 ; CHECK-NEXT: rsbs r0, r0, #0
107 ; CHECK-NEXT: vmsr p0, r0
108 ; CHECK-NEXT: vpsel q0, q0, q1
111 %c = icmp ult i32 %s, %t
112 %vc1 = insertelement <8 x i1> undef, i1 %c, i64 0
113 %vc4 = shufflevector <8 x i1> %vc1, <8 x i1> undef, <8 x i32> zeroinitializer
114 %r = select <8 x i1> %vc4, <8 x i16> %a, <8 x i16> %b
119 define arm_aapcs_vfpcc <16 x i8> @build_var0_v16i1(i32 %s, i32 %t, <16 x i8> %a, <16 x i8> %b) {
120 ; CHECK-LABEL: build_var0_v16i1:
121 ; CHECK: @ %bb.0: @ %entry
122 ; CHECK-NEXT: cmp r0, r1
123 ; CHECK-NEXT: mov.w r1, #0
124 ; CHECK-NEXT: cset r0, lo
125 ; CHECK-NEXT: and r0, r0, #1
126 ; CHECK-NEXT: rsbs r0, r0, #0
127 ; CHECK-NEXT: bfi r1, r0, #0, #1
128 ; CHECK-NEXT: vmsr p0, r1
129 ; CHECK-NEXT: vpsel q0, q0, q1
132 %c = icmp ult i32 %s, %t
133 %vc = insertelement <16 x i1> zeroinitializer, i1 %c, i64 0
134 %r = select <16 x i1> %vc, <16 x i8> %a, <16 x i8> %b
138 define arm_aapcs_vfpcc <16 x i8> @build_var3_v16i1(i32 %s, i32 %t, <16 x i8> %a, <16 x i8> %b) {
139 ; CHECK-LABEL: build_var3_v16i1:
140 ; CHECK: @ %bb.0: @ %entry
141 ; CHECK-NEXT: cmp r0, r1
142 ; CHECK-NEXT: mov.w r1, #0
143 ; CHECK-NEXT: cset r0, lo
144 ; CHECK-NEXT: and r0, r0, #1
145 ; CHECK-NEXT: rsbs r0, r0, #0
146 ; CHECK-NEXT: bfi r1, r0, #3, #1
147 ; CHECK-NEXT: vmsr p0, r1
148 ; CHECK-NEXT: vpsel q0, q0, q1
151 %c = icmp ult i32 %s, %t
152 %vc = insertelement <16 x i1> zeroinitializer, i1 %c, i64 3
153 %r = select <16 x i1> %vc, <16 x i8> %a, <16 x i8> %b
157 define arm_aapcs_vfpcc <16 x i8> @build_varN_v16i1(i32 %s, i32 %t, <16 x i8> %a, <16 x i8> %b) {
158 ; CHECK-LABEL: build_varN_v16i1:
159 ; CHECK: @ %bb.0: @ %entry
160 ; CHECK-NEXT: cmp r0, r1
161 ; CHECK-NEXT: cset r0, lo
162 ; CHECK-NEXT: and r0, r0, #1
163 ; CHECK-NEXT: rsbs r0, r0, #0
164 ; CHECK-NEXT: vmsr p0, r0
165 ; CHECK-NEXT: vpsel q0, q0, q1
168 %c = icmp ult i32 %s, %t
169 %vc1 = insertelement <16 x i1> undef, i1 %c, i64 0
170 %vc4 = shufflevector <16 x i1> %vc1, <16 x i1> undef, <16 x i32> zeroinitializer
171 %r = select <16 x i1> %vc4, <16 x i8> %a, <16 x i8> %b
176 define arm_aapcs_vfpcc <2 x i64> @build_var0_v2i1(i32 %s, i32 %t, <2 x i64> %a, <2 x i64> %b) {
177 ; CHECK-LABEL: build_var0_v2i1:
178 ; CHECK: @ %bb.0: @ %entry
179 ; CHECK-NEXT: cmp r0, r1
180 ; CHECK-NEXT: cset r0, lo
181 ; CHECK-NEXT: and r0, r0, #1
182 ; CHECK-NEXT: rsbs r0, r0, #0
183 ; CHECK-NEXT: vmov s8, r0
184 ; CHECK-NEXT: vldr s10, .LCPI9_0
185 ; CHECK-NEXT: vmov.f32 s9, s8
186 ; CHECK-NEXT: vmov.f32 s11, s10
187 ; CHECK-NEXT: vbic q1, q1, q2
188 ; CHECK-NEXT: vand q0, q0, q2
189 ; CHECK-NEXT: vorr q0, q0, q1
191 ; CHECK-NEXT: .p2align 2
192 ; CHECK-NEXT: @ %bb.1:
193 ; CHECK-NEXT: .LCPI9_0:
194 ; CHECK-NEXT: .long 0 @ float 0
196 %c = icmp ult i32 %s, %t
197 %vc = insertelement <2 x i1> zeroinitializer, i1 %c, i64 0
198 %r = select <2 x i1> %vc, <2 x i64> %a, <2 x i64> %b
202 define arm_aapcs_vfpcc <2 x i64> @build_var1_v2i1(i32 %s, i32 %t, <2 x i64> %a, <2 x i64> %b) {
203 ; CHECK-LABEL: build_var1_v2i1:
204 ; CHECK: @ %bb.0: @ %entry
205 ; CHECK-NEXT: cmp r0, r1
206 ; CHECK-NEXT: cset r0, lo
207 ; CHECK-NEXT: and r0, r0, #1
208 ; CHECK-NEXT: rsbs r0, r0, #0
209 ; CHECK-NEXT: vmov s10, r0
210 ; CHECK-NEXT: vldr s8, .LCPI10_0
211 ; CHECK-NEXT: vmov.f32 s9, s8
212 ; CHECK-NEXT: vmov.f32 s11, s10
213 ; CHECK-NEXT: vbic q1, q1, q2
214 ; CHECK-NEXT: vand q0, q0, q2
215 ; CHECK-NEXT: vorr q0, q0, q1
217 ; CHECK-NEXT: .p2align 2
218 ; CHECK-NEXT: @ %bb.1:
219 ; CHECK-NEXT: .LCPI10_0:
220 ; CHECK-NEXT: .long 0 @ float 0
222 %c = icmp ult i32 %s, %t
223 %vc = insertelement <2 x i1> zeroinitializer, i1 %c, i64 1
224 %r = select <2 x i1> %vc, <2 x i64> %a, <2 x i64> %b
228 define arm_aapcs_vfpcc <2 x i64> @build_varN_v2i1(i32 %s, i32 %t, <2 x i64> %a, <2 x i64> %b) {
229 ; CHECK-LABEL: build_varN_v2i1:
230 ; CHECK: @ %bb.0: @ %entry
231 ; CHECK-NEXT: cmp r0, r1
232 ; CHECK-NEXT: cset r0, lo
233 ; CHECK-NEXT: and r0, r0, #1
234 ; CHECK-NEXT: rsbs r0, r0, #0
235 ; CHECK-NEXT: vdup.32 q2, r0
236 ; CHECK-NEXT: vbic q1, q1, q2
237 ; CHECK-NEXT: vand q0, q0, q2
238 ; CHECK-NEXT: vorr q0, q0, q1
241 %c = icmp ult i32 %s, %t
242 %vc1 = insertelement <2 x i1> undef, i1 %c, i64 0
243 %vc4 = shufflevector <2 x i1> %vc1, <2 x i1> undef, <2 x i32> zeroinitializer
244 %r = select <2 x i1> %vc4, <2 x i64> %a, <2 x i64> %b