1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve %s -o - | FileCheck %s
4 define arm_aapcs_vfpcc <16 x i8> @add_ashr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
5 ; CHECK-LABEL: add_ashr_v16i8:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: vadd.i8 q0, q0, q1
8 ; CHECK-NEXT: vshr.s8 q0, q0, #1
11 %0 = add <16 x i8> %src1, %src2
12 %1 = ashr <16 x i8> %0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
16 define arm_aapcs_vfpcc <8 x i16> @add_ashr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
17 ; CHECK-LABEL: add_ashr_v8i16:
18 ; CHECK: @ %bb.0: @ %entry
19 ; CHECK-NEXT: vadd.i16 q0, q0, q1
20 ; CHECK-NEXT: vshr.s16 q0, q0, #1
23 %0 = add <8 x i16> %src1, %src2
24 %1 = ashr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
28 define arm_aapcs_vfpcc <4 x i32> @add_ashr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
29 ; CHECK-LABEL: add_ashr_v4i32:
30 ; CHECK: @ %bb.0: @ %entry
31 ; CHECK-NEXT: vhadd.s32 q0, q0, q1
34 %0 = add nsw <4 x i32> %src1, %src2
35 %1 = ashr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
39 define arm_aapcs_vfpcc <16 x i8> @add_lshr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
40 ; CHECK-LABEL: add_lshr_v16i8:
41 ; CHECK: @ %bb.0: @ %entry
42 ; CHECK-NEXT: vadd.i8 q0, q0, q1
43 ; CHECK-NEXT: vshr.u8 q0, q0, #1
46 %0 = add <16 x i8> %src1, %src2
47 %1 = lshr <16 x i8> %0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
51 define arm_aapcs_vfpcc <8 x i16> @add_lshr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
52 ; CHECK-LABEL: add_lshr_v8i16:
53 ; CHECK: @ %bb.0: @ %entry
54 ; CHECK-NEXT: vadd.i16 q0, q0, q1
55 ; CHECK-NEXT: vshr.u16 q0, q0, #1
58 %0 = add <8 x i16> %src1, %src2
59 %1 = lshr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
63 define arm_aapcs_vfpcc <4 x i32> @add_lshr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
64 ; CHECK-LABEL: add_lshr_v4i32:
65 ; CHECK: @ %bb.0: @ %entry
66 ; CHECK-NEXT: vadd.i32 q0, q0, q1
67 ; CHECK-NEXT: vshr.u32 q0, q0, #1
70 %0 = add nsw <4 x i32> %src1, %src2
71 %1 = lshr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
75 define arm_aapcs_vfpcc <16 x i8> @sub_ashr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
76 ; CHECK-LABEL: sub_ashr_v16i8:
77 ; CHECK: @ %bb.0: @ %entry
78 ; CHECK-NEXT: vsub.i8 q0, q0, q1
79 ; CHECK-NEXT: vshr.s8 q0, q0, #1
82 %0 = sub <16 x i8> %src1, %src2
83 %1 = ashr <16 x i8> %0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
87 define arm_aapcs_vfpcc <8 x i16> @sub_ashr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
88 ; CHECK-LABEL: sub_ashr_v8i16:
89 ; CHECK: @ %bb.0: @ %entry
90 ; CHECK-NEXT: vsub.i16 q0, q0, q1
91 ; CHECK-NEXT: vshr.s16 q0, q0, #1
94 %0 = sub <8 x i16> %src1, %src2
95 %1 = ashr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
99 define arm_aapcs_vfpcc <4 x i32> @sub_ashr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
100 ; CHECK-LABEL: sub_ashr_v4i32:
101 ; CHECK: @ %bb.0: @ %entry
102 ; CHECK-NEXT: vhsub.s32 q0, q0, q1
105 %0 = sub nsw <4 x i32> %src1, %src2
106 %1 = ashr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
110 define arm_aapcs_vfpcc <16 x i8> @sub_lshr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
111 ; CHECK-LABEL: sub_lshr_v16i8:
112 ; CHECK: @ %bb.0: @ %entry
113 ; CHECK-NEXT: vsub.i8 q0, q0, q1
114 ; CHECK-NEXT: vshr.u8 q0, q0, #1
117 %0 = sub <16 x i8> %src1, %src2
118 %1 = lshr <16 x i8> %0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
122 define arm_aapcs_vfpcc <8 x i16> @sub_lshr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
123 ; CHECK-LABEL: sub_lshr_v8i16:
124 ; CHECK: @ %bb.0: @ %entry
125 ; CHECK-NEXT: vsub.i16 q0, q0, q1
126 ; CHECK-NEXT: vshr.u16 q0, q0, #1
129 %0 = sub <8 x i16> %src1, %src2
130 %1 = lshr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
134 define arm_aapcs_vfpcc <4 x i32> @sub_lshr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
135 ; CHECK-LABEL: sub_lshr_v4i32:
136 ; CHECK: @ %bb.0: @ %entry
137 ; CHECK-NEXT: vsub.i32 q0, q0, q1
138 ; CHECK-NEXT: vshr.u32 q0, q0, #1
141 %0 = sub nsw <4 x i32> %src1, %src2
142 %1 = lshr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
148 define arm_aapcs_vfpcc <16 x i8> @add_sdiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
149 ; CHECK-LABEL: add_sdiv_v16i8:
150 ; CHECK: @ %bb.0: @ %entry
151 ; CHECK-NEXT: vadd.i8 q0, q0, q1
152 ; CHECK-NEXT: vshr.u8 q1, q0, #7
153 ; CHECK-NEXT: vadd.i8 q0, q0, q1
154 ; CHECK-NEXT: vshr.s8 q0, q0, #1
157 %0 = add <16 x i8> %src1, %src2
158 %1 = sdiv <16 x i8> %0, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
162 define arm_aapcs_vfpcc <8 x i16> @add_sdiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
163 ; CHECK-LABEL: add_sdiv_v8i16:
164 ; CHECK: @ %bb.0: @ %entry
165 ; CHECK-NEXT: vadd.i16 q0, q0, q1
166 ; CHECK-NEXT: vshr.u16 q1, q0, #15
167 ; CHECK-NEXT: vadd.i16 q0, q0, q1
168 ; CHECK-NEXT: vshr.s16 q0, q0, #1
171 %0 = add <8 x i16> %src1, %src2
172 %1 = sdiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
176 define arm_aapcs_vfpcc <4 x i32> @add_sdiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
177 ; CHECK-LABEL: add_sdiv_v4i32:
178 ; CHECK: @ %bb.0: @ %entry
179 ; CHECK-NEXT: vadd.i32 q0, q0, q1
180 ; CHECK-NEXT: vshr.u32 q1, q0, #31
181 ; CHECK-NEXT: vadd.i32 q0, q0, q1
182 ; CHECK-NEXT: vshr.s32 q0, q0, #1
185 %0 = add nsw <4 x i32> %src1, %src2
186 %1 = sdiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>
190 define arm_aapcs_vfpcc <16 x i8> @add_udiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
191 ; CHECK-LABEL: add_udiv_v16i8:
192 ; CHECK: @ %bb.0: @ %entry
193 ; CHECK-NEXT: vadd.i8 q0, q0, q1
194 ; CHECK-NEXT: vshr.u8 q0, q0, #1
197 %0 = add <16 x i8> %src1, %src2
198 %1 = udiv <16 x i8> %0, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
202 define arm_aapcs_vfpcc <8 x i16> @add_udiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
203 ; CHECK-LABEL: add_udiv_v8i16:
204 ; CHECK: @ %bb.0: @ %entry
205 ; CHECK-NEXT: vadd.i16 q0, q0, q1
206 ; CHECK-NEXT: vshr.u16 q0, q0, #1
209 %0 = add <8 x i16> %src1, %src2
210 %1 = udiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
214 define arm_aapcs_vfpcc <4 x i32> @add_udiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
215 ; CHECK-LABEL: add_udiv_v4i32:
216 ; CHECK: @ %bb.0: @ %entry
217 ; CHECK-NEXT: vadd.i32 q0, q0, q1
218 ; CHECK-NEXT: vshr.u32 q0, q0, #1
221 %0 = add nsw <4 x i32> %src1, %src2
222 %1 = udiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>
226 define arm_aapcs_vfpcc <16 x i8> @sub_sdiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
227 ; CHECK-LABEL: sub_sdiv_v16i8:
228 ; CHECK: @ %bb.0: @ %entry
229 ; CHECK-NEXT: vsub.i8 q0, q0, q1
230 ; CHECK-NEXT: vshr.u8 q1, q0, #7
231 ; CHECK-NEXT: vadd.i8 q0, q0, q1
232 ; CHECK-NEXT: vshr.s8 q0, q0, #1
235 %0 = sub <16 x i8> %src1, %src2
236 %1 = sdiv <16 x i8> %0, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
240 define arm_aapcs_vfpcc <8 x i16> @sub_sdiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
241 ; CHECK-LABEL: sub_sdiv_v8i16:
242 ; CHECK: @ %bb.0: @ %entry
243 ; CHECK-NEXT: vsub.i16 q0, q0, q1
244 ; CHECK-NEXT: vshr.u16 q1, q0, #15
245 ; CHECK-NEXT: vadd.i16 q0, q0, q1
246 ; CHECK-NEXT: vshr.s16 q0, q0, #1
249 %0 = sub <8 x i16> %src1, %src2
250 %1 = sdiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
254 define arm_aapcs_vfpcc <4 x i32> @sub_sdiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
255 ; CHECK-LABEL: sub_sdiv_v4i32:
256 ; CHECK: @ %bb.0: @ %entry
257 ; CHECK-NEXT: vsub.i32 q0, q0, q1
258 ; CHECK-NEXT: vshr.u32 q1, q0, #31
259 ; CHECK-NEXT: vadd.i32 q0, q0, q1
260 ; CHECK-NEXT: vshr.s32 q0, q0, #1
263 %0 = sub nsw <4 x i32> %src1, %src2
264 %1 = sdiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>
268 define arm_aapcs_vfpcc <16 x i8> @sub_udiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
269 ; CHECK-LABEL: sub_udiv_v16i8:
270 ; CHECK: @ %bb.0: @ %entry
271 ; CHECK-NEXT: vsub.i8 q0, q0, q1
272 ; CHECK-NEXT: vshr.u8 q0, q0, #1
275 %0 = sub <16 x i8> %src1, %src2
276 %1 = udiv <16 x i8> %0, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
280 define arm_aapcs_vfpcc <8 x i16> @sub_udiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
281 ; CHECK-LABEL: sub_udiv_v8i16:
282 ; CHECK: @ %bb.0: @ %entry
283 ; CHECK-NEXT: vsub.i16 q0, q0, q1
284 ; CHECK-NEXT: vshr.u16 q0, q0, #1
287 %0 = sub <8 x i16> %src1, %src2
288 %1 = udiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
292 define arm_aapcs_vfpcc <4 x i32> @sub_udiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
293 ; CHECK-LABEL: sub_udiv_v4i32:
294 ; CHECK: @ %bb.0: @ %entry
295 ; CHECK-NEXT: vsub.i32 q0, q0, q1
296 ; CHECK-NEXT: vshr.u32 q0, q0, #1
299 %0 = sub nsw <4 x i32> %src1, %src2
300 %1 = udiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>