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 --check-prefix=CHECK --check-prefix=CHECK-LE
3 ; RUN: llc -mtriple=thumbebv8.1m.main-arm-none-eabi -mattr=+mve -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-BE
5 define arm_aapcs_vfpcc <4 x i32> @load_v4i1(<4 x i1> *%src, <4 x i32> %a) {
6 ; CHECK-LE-LABEL: load_v4i1:
7 ; CHECK-LE: @ %bb.0: @ %entry
8 ; CHECK-LE-NEXT: vldr p0, [r0]
9 ; CHECK-LE-NEXT: vmov.i32 q1, #0x0
10 ; CHECK-LE-NEXT: vpsel q0, q0, q1
11 ; CHECK-LE-NEXT: bx lr
13 ; CHECK-BE-LABEL: load_v4i1:
14 ; CHECK-BE: @ %bb.0: @ %entry
15 ; CHECK-BE-NEXT: vldr p0, [r0]
16 ; CHECK-BE-NEXT: vrev64.32 q1, q0
17 ; CHECK-BE-NEXT: vmov.i32 q0, #0x0
18 ; CHECK-BE-NEXT: vpsel q1, q1, q0
19 ; CHECK-BE-NEXT: vrev64.32 q0, q1
20 ; CHECK-BE-NEXT: bx lr
22 %c = load <4 x i1>, <4 x i1>* %src
23 %s = select <4 x i1> %c, <4 x i32> %a, <4 x i32> zeroinitializer
27 define arm_aapcs_vfpcc <8 x i16> @load_v8i1(<8 x i1> *%src, <8 x i16> %a) {
28 ; CHECK-LE-LABEL: load_v8i1:
29 ; CHECK-LE: @ %bb.0: @ %entry
30 ; CHECK-LE-NEXT: vldr p0, [r0]
31 ; CHECK-LE-NEXT: vmov.i32 q1, #0x0
32 ; CHECK-LE-NEXT: vpsel q0, q0, q1
33 ; CHECK-LE-NEXT: bx lr
35 ; CHECK-BE-LABEL: load_v8i1:
36 ; CHECK-BE: @ %bb.0: @ %entry
37 ; CHECK-BE-NEXT: vrev64.16 q1, q0
38 ; CHECK-BE-NEXT: vmov.i32 q0, #0x0
39 ; CHECK-BE-NEXT: vldr p0, [r0]
40 ; CHECK-BE-NEXT: vrev32.16 q0, q0
41 ; CHECK-BE-NEXT: vpsel q1, q1, q0
42 ; CHECK-BE-NEXT: vrev64.16 q0, q1
43 ; CHECK-BE-NEXT: bx lr
45 %c = load <8 x i1>, <8 x i1>* %src
46 %s = select <8 x i1> %c, <8 x i16> %a, <8 x i16> zeroinitializer
50 define arm_aapcs_vfpcc <16 x i8> @load_v16i1(<16 x i1> *%src, <16 x i8> %a) {
51 ; CHECK-LE-LABEL: load_v16i1:
52 ; CHECK-LE: @ %bb.0: @ %entry
53 ; CHECK-LE-NEXT: vldr p0, [r0]
54 ; CHECK-LE-NEXT: vmov.i32 q1, #0x0
55 ; CHECK-LE-NEXT: vpsel q0, q0, q1
56 ; CHECK-LE-NEXT: bx lr
58 ; CHECK-BE-LABEL: load_v16i1:
59 ; CHECK-BE: @ %bb.0: @ %entry
60 ; CHECK-BE-NEXT: vrev64.8 q1, q0
61 ; CHECK-BE-NEXT: vmov.i32 q0, #0x0
62 ; CHECK-BE-NEXT: vldr p0, [r0]
63 ; CHECK-BE-NEXT: vrev32.8 q0, q0
64 ; CHECK-BE-NEXT: vpsel q1, q1, q0
65 ; CHECK-BE-NEXT: vrev64.8 q0, q1
66 ; CHECK-BE-NEXT: bx lr
68 %c = load <16 x i1>, <16 x i1>* %src
69 %s = select <16 x i1> %c, <16 x i8> %a, <16 x i8> zeroinitializer
73 define arm_aapcs_vfpcc <2 x i64> @load_v2i1(<2 x i1> *%src, <2 x i64> %a) {
74 ; CHECK-LE-LABEL: load_v2i1:
75 ; CHECK-LE: @ %bb.0: @ %entry
76 ; CHECK-LE-NEXT: ldrb r0, [r0]
77 ; CHECK-LE-NEXT: sbfx r1, r0, #0, #1
78 ; CHECK-LE-NEXT: sbfx r0, r0, #1, #1
79 ; CHECK-LE-NEXT: vmov.32 q1[0], r1
80 ; CHECK-LE-NEXT: vmov.32 q1[1], r1
81 ; CHECK-LE-NEXT: vmov.32 q1[2], r0
82 ; CHECK-LE-NEXT: vmov.32 q1[3], r0
83 ; CHECK-LE-NEXT: vand q0, q0, q1
84 ; CHECK-LE-NEXT: bx lr
86 ; CHECK-BE-LABEL: load_v2i1:
87 ; CHECK-BE: @ %bb.0: @ %entry
88 ; CHECK-BE-NEXT: ldrb r0, [r0]
89 ; CHECK-BE-NEXT: sbfx r1, r0, #0, #1
90 ; CHECK-BE-NEXT: sbfx r0, r0, #1, #1
91 ; CHECK-BE-NEXT: vmov.32 q1[0], r1
92 ; CHECK-BE-NEXT: vmov.32 q1[1], r1
93 ; CHECK-BE-NEXT: vmov.32 q1[2], r0
94 ; CHECK-BE-NEXT: vmov.32 q1[3], r0
95 ; CHECK-BE-NEXT: vrev64.32 q2, q1
96 ; CHECK-BE-NEXT: vand q0, q0, q2
97 ; CHECK-BE-NEXT: bx lr
99 %c = load <2 x i1>, <2 x i1>* %src
100 %s = select <2 x i1> %c, <2 x i64> %a, <2 x i64> zeroinitializer
105 define arm_aapcs_vfpcc void @store_v4i1(<4 x i1> *%dst, <4 x i32> %a) {
106 ; CHECK-LE-LABEL: store_v4i1:
107 ; CHECK-LE: @ %bb.0: @ %entry
108 ; CHECK-LE-NEXT: vcmp.i32 eq, q0, zr
109 ; CHECK-LE-NEXT: vstr p0, [r0]
110 ; CHECK-LE-NEXT: bx lr
112 ; CHECK-BE-LABEL: store_v4i1:
113 ; CHECK-BE: @ %bb.0: @ %entry
114 ; CHECK-BE-NEXT: vrev64.32 q1, q0
115 ; CHECK-BE-NEXT: vcmp.i32 eq, q1, zr
116 ; CHECK-BE-NEXT: vstr p0, [r0]
117 ; CHECK-BE-NEXT: bx lr
119 %c = icmp eq <4 x i32> %a, zeroinitializer
120 store <4 x i1> %c, <4 x i1>* %dst
124 define arm_aapcs_vfpcc void @store_v8i1(<8 x i1> *%dst, <8 x i16> %a) {
125 ; CHECK-LE-LABEL: store_v8i1:
126 ; CHECK-LE: @ %bb.0: @ %entry
127 ; CHECK-LE-NEXT: vcmp.i16 eq, q0, zr
128 ; CHECK-LE-NEXT: vstr p0, [r0]
129 ; CHECK-LE-NEXT: bx lr
131 ; CHECK-BE-LABEL: store_v8i1:
132 ; CHECK-BE: @ %bb.0: @ %entry
133 ; CHECK-BE-NEXT: vrev64.16 q1, q0
134 ; CHECK-BE-NEXT: vcmp.i16 eq, q1, zr
135 ; CHECK-BE-NEXT: vstr p0, [r0]
136 ; CHECK-BE-NEXT: bx lr
138 %c = icmp eq <8 x i16> %a, zeroinitializer
139 store <8 x i1> %c, <8 x i1>* %dst
143 define arm_aapcs_vfpcc void @store_v16i1(<16 x i1> *%dst, <16 x i8> %a) {
144 ; CHECK-LE-LABEL: store_v16i1:
145 ; CHECK-LE: @ %bb.0: @ %entry
146 ; CHECK-LE-NEXT: vcmp.i8 eq, q0, zr
147 ; CHECK-LE-NEXT: vstr p0, [r0]
148 ; CHECK-LE-NEXT: bx lr
150 ; CHECK-BE-LABEL: store_v16i1:
151 ; CHECK-BE: @ %bb.0: @ %entry
152 ; CHECK-BE-NEXT: vrev64.8 q1, q0
153 ; CHECK-BE-NEXT: vcmp.i8 eq, q1, zr
154 ; CHECK-BE-NEXT: vstr p0, [r0]
155 ; CHECK-BE-NEXT: bx lr
157 %c = icmp eq <16 x i8> %a, zeroinitializer
158 store <16 x i1> %c, <16 x i1>* %dst
162 define arm_aapcs_vfpcc void @store_v2i1(<2 x i1> *%dst, <2 x i64> %a) {
163 ; CHECK-LE-LABEL: store_v2i1:
164 ; CHECK-LE: @ %bb.0: @ %entry
165 ; CHECK-LE-NEXT: vmov r1, s1
166 ; CHECK-LE-NEXT: vmov r2, s0
167 ; CHECK-LE-NEXT: vmov r3, s2
168 ; CHECK-LE-NEXT: orrs r1, r2
169 ; CHECK-LE-NEXT: vmov r2, s3
170 ; CHECK-LE-NEXT: cset r1, eq
171 ; CHECK-LE-NEXT: orrs r2, r3
172 ; CHECK-LE-NEXT: cset r2, eq
173 ; CHECK-LE-NEXT: ands r2, r2, #1
174 ; CHECK-LE-NEXT: it ne
175 ; CHECK-LE-NEXT: mvnne r2, #1
176 ; CHECK-LE-NEXT: bfi r2, r1, #0, #1
177 ; CHECK-LE-NEXT: and r1, r2, #3
178 ; CHECK-LE-NEXT: strb r1, [r0]
179 ; CHECK-LE-NEXT: bx lr
181 ; CHECK-BE-LABEL: store_v2i1:
182 ; CHECK-BE: @ %bb.0: @ %entry
183 ; CHECK-BE-NEXT: vrev64.32 q1, q0
184 ; CHECK-BE-NEXT: vmov r1, s6
185 ; CHECK-BE-NEXT: vmov r2, s7
186 ; CHECK-BE-NEXT: vmov r3, s5
187 ; CHECK-BE-NEXT: orrs r1, r2
188 ; CHECK-BE-NEXT: vmov r2, s4
189 ; CHECK-BE-NEXT: cset r1, eq
190 ; CHECK-BE-NEXT: orrs r2, r3
191 ; CHECK-BE-NEXT: cset r2, eq
192 ; CHECK-BE-NEXT: ands r2, r2, #1
193 ; CHECK-BE-NEXT: it ne
194 ; CHECK-BE-NEXT: mvnne r2, #1
195 ; CHECK-BE-NEXT: bfi r2, r1, #0, #1
196 ; CHECK-BE-NEXT: and r1, r2, #3
197 ; CHECK-BE-NEXT: strb r1, [r0]
198 ; CHECK-BE-NEXT: bx lr
200 %c = icmp eq <2 x i64> %a, zeroinitializer
201 store <2 x i1> %c, <2 x i1>* %dst