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 %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: vhadd.s8 q0, q0, q1
10 %0 = add <16 x i8> %src1, %src2
11 %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>
15 define arm_aapcs_vfpcc <8 x i16> @add_ashr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
16 ; CHECK-LABEL: add_ashr_v8i16:
17 ; CHECK: @ %bb.0: @ %entry
18 ; CHECK-NEXT: vhadd.s16 q0, q0, q1
21 %0 = add <8 x i16> %src1, %src2
22 %1 = ashr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
26 define arm_aapcs_vfpcc <4 x i32> @add_ashr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
27 ; CHECK-LABEL: add_ashr_v4i32:
28 ; CHECK: @ %bb.0: @ %entry
29 ; CHECK-NEXT: vhadd.s32 q0, q0, q1
32 %0 = add nsw <4 x i32> %src1, %src2
33 %1 = ashr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
37 define arm_aapcs_vfpcc <16 x i8> @add_lshr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
38 ; CHECK-LABEL: add_lshr_v16i8:
39 ; CHECK: @ %bb.0: @ %entry
40 ; CHECK-NEXT: vhadd.u8 q0, q0, q1
43 %0 = add <16 x i8> %src1, %src2
44 %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>
48 define arm_aapcs_vfpcc <8 x i16> @add_lshr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
49 ; CHECK-LABEL: add_lshr_v8i16:
50 ; CHECK: @ %bb.0: @ %entry
51 ; CHECK-NEXT: vhadd.u16 q0, q0, q1
54 %0 = add <8 x i16> %src1, %src2
55 %1 = lshr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
59 define arm_aapcs_vfpcc <4 x i32> @add_lshr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
60 ; CHECK-LABEL: add_lshr_v4i32:
61 ; CHECK: @ %bb.0: @ %entry
62 ; CHECK-NEXT: vhadd.u32 q0, q0, q1
65 %0 = add nsw <4 x i32> %src1, %src2
66 %1 = lshr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
70 define arm_aapcs_vfpcc <16 x i8> @sub_ashr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
71 ; CHECK-LABEL: sub_ashr_v16i8:
72 ; CHECK: @ %bb.0: @ %entry
73 ; CHECK-NEXT: vhsub.s8 q0, q0, q1
76 %0 = sub <16 x i8> %src1, %src2
77 %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>
81 define arm_aapcs_vfpcc <8 x i16> @sub_ashr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
82 ; CHECK-LABEL: sub_ashr_v8i16:
83 ; CHECK: @ %bb.0: @ %entry
84 ; CHECK-NEXT: vhsub.s16 q0, q0, q1
87 %0 = sub <8 x i16> %src1, %src2
88 %1 = ashr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
92 define arm_aapcs_vfpcc <4 x i32> @sub_ashr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
93 ; CHECK-LABEL: sub_ashr_v4i32:
94 ; CHECK: @ %bb.0: @ %entry
95 ; CHECK-NEXT: vhsub.s32 q0, q0, q1
98 %0 = sub nsw <4 x i32> %src1, %src2
99 %1 = ashr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
103 define arm_aapcs_vfpcc <16 x i8> @sub_lshr_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
104 ; CHECK-LABEL: sub_lshr_v16i8:
105 ; CHECK: @ %bb.0: @ %entry
106 ; CHECK-NEXT: vhsub.u8 q0, q0, q1
109 %0 = sub <16 x i8> %src1, %src2
110 %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>
114 define arm_aapcs_vfpcc <8 x i16> @sub_lshr_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
115 ; CHECK-LABEL: sub_lshr_v8i16:
116 ; CHECK: @ %bb.0: @ %entry
117 ; CHECK-NEXT: vhsub.u16 q0, q0, q1
120 %0 = sub <8 x i16> %src1, %src2
121 %1 = lshr <8 x i16> %0, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
125 define arm_aapcs_vfpcc <4 x i32> @sub_lshr_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
126 ; CHECK-LABEL: sub_lshr_v4i32:
127 ; CHECK: @ %bb.0: @ %entry
128 ; CHECK-NEXT: vhsub.u32 q0, q0, q1
131 %0 = sub nsw <4 x i32> %src1, %src2
132 %1 = lshr <4 x i32> %0, <i32 1, i32 1, i32 1, i32 1>
138 define arm_aapcs_vfpcc <16 x i8> @add_sdiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
139 ; CHECK-LABEL: add_sdiv_v16i8:
140 ; CHECK: @ %bb.0: @ %entry
141 ; CHECK-NEXT: vadd.i8 q0, q0, q1
142 ; CHECK-NEXT: vshr.u8 q1, q0, #7
143 ; CHECK-NEXT: vhadd.s8 q0, q0, q1
146 %0 = add <16 x i8> %src1, %src2
147 %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>
151 define arm_aapcs_vfpcc <8 x i16> @add_sdiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
152 ; CHECK-LABEL: add_sdiv_v8i16:
153 ; CHECK: @ %bb.0: @ %entry
154 ; CHECK-NEXT: vadd.i16 q0, q0, q1
155 ; CHECK-NEXT: vshr.u16 q1, q0, #15
156 ; CHECK-NEXT: vhadd.s16 q0, q0, q1
159 %0 = add <8 x i16> %src1, %src2
160 %1 = sdiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
164 define arm_aapcs_vfpcc <4 x i32> @add_sdiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
165 ; CHECK-LABEL: add_sdiv_v4i32:
166 ; CHECK: @ %bb.0: @ %entry
167 ; CHECK-NEXT: vadd.i32 q0, q0, q1
168 ; CHECK-NEXT: vshr.u32 q1, q0, #31
169 ; CHECK-NEXT: vhadd.s32 q0, q0, q1
172 %0 = add nsw <4 x i32> %src1, %src2
173 %1 = sdiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>
177 define arm_aapcs_vfpcc <16 x i8> @add_udiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
178 ; CHECK-LABEL: add_udiv_v16i8:
179 ; CHECK: @ %bb.0: @ %entry
180 ; CHECK-NEXT: vhadd.u8 q0, q0, q1
183 %0 = add <16 x i8> %src1, %src2
184 %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>
188 define arm_aapcs_vfpcc <8 x i16> @add_udiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
189 ; CHECK-LABEL: add_udiv_v8i16:
190 ; CHECK: @ %bb.0: @ %entry
191 ; CHECK-NEXT: vhadd.u16 q0, q0, q1
194 %0 = add <8 x i16> %src1, %src2
195 %1 = udiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
199 define arm_aapcs_vfpcc <4 x i32> @add_udiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
200 ; CHECK-LABEL: add_udiv_v4i32:
201 ; CHECK: @ %bb.0: @ %entry
202 ; CHECK-NEXT: vhadd.u32 q0, q0, q1
205 %0 = add nsw <4 x i32> %src1, %src2
206 %1 = udiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>
210 define arm_aapcs_vfpcc <16 x i8> @sub_sdiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
211 ; CHECK-LABEL: sub_sdiv_v16i8:
212 ; CHECK: @ %bb.0: @ %entry
213 ; CHECK-NEXT: vsub.i8 q0, q0, q1
214 ; CHECK-NEXT: vshr.u8 q1, q0, #7
215 ; CHECK-NEXT: vhadd.s8 q0, q0, q1
218 %0 = sub <16 x i8> %src1, %src2
219 %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>
223 define arm_aapcs_vfpcc <8 x i16> @sub_sdiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
224 ; CHECK-LABEL: sub_sdiv_v8i16:
225 ; CHECK: @ %bb.0: @ %entry
226 ; CHECK-NEXT: vsub.i16 q0, q0, q1
227 ; CHECK-NEXT: vshr.u16 q1, q0, #15
228 ; CHECK-NEXT: vhadd.s16 q0, q0, q1
231 %0 = sub <8 x i16> %src1, %src2
232 %1 = sdiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
236 define arm_aapcs_vfpcc <4 x i32> @sub_sdiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
237 ; CHECK-LABEL: sub_sdiv_v4i32:
238 ; CHECK: @ %bb.0: @ %entry
239 ; CHECK-NEXT: vsub.i32 q0, q0, q1
240 ; CHECK-NEXT: vshr.u32 q1, q0, #31
241 ; CHECK-NEXT: vhadd.s32 q0, q0, q1
244 %0 = sub nsw <4 x i32> %src1, %src2
245 %1 = sdiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>
249 define arm_aapcs_vfpcc <16 x i8> @sub_udiv_v16i8(<16 x i8> %src1, <16 x i8> %src2) {
250 ; CHECK-LABEL: sub_udiv_v16i8:
251 ; CHECK: @ %bb.0: @ %entry
252 ; CHECK-NEXT: vhsub.u8 q0, q0, q1
255 %0 = sub <16 x i8> %src1, %src2
256 %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>
260 define arm_aapcs_vfpcc <8 x i16> @sub_udiv_v8i16(<8 x i16> %src1, <8 x i16> %src2) {
261 ; CHECK-LABEL: sub_udiv_v8i16:
262 ; CHECK: @ %bb.0: @ %entry
263 ; CHECK-NEXT: vhsub.u16 q0, q0, q1
266 %0 = sub <8 x i16> %src1, %src2
267 %1 = udiv <8 x i16> %0, <i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2, i16 2>
271 define arm_aapcs_vfpcc <4 x i32> @sub_udiv_v4i32(<4 x i32> %src1, <4 x i32> %src2) {
272 ; CHECK-LABEL: sub_udiv_v4i32:
273 ; CHECK: @ %bb.0: @ %entry
274 ; CHECK-NEXT: vhsub.u32 q0, q0, q1
277 %0 = sub nsw <4 x i32> %src1, %src2
278 %1 = udiv <4 x i32> %0, <i32 2, i32 2, i32 2, i32 2>