1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main -mattr=+mve -verify-machineinstrs -o - %s | FileCheck %s
4 define i64 @test_asrl(i64 %value, i32 %shift) {
5 ; CHECK-LABEL: test_asrl:
6 ; CHECK: @ %bb.0: @ %entry
7 ; CHECK-NEXT: asrl r0, r1, r2
10 %0 = lshr i64 %value, 32
11 %1 = trunc i64 %0 to i32
12 %2 = trunc i64 %value to i32
13 %3 = call { i32, i32 } @llvm.arm.mve.asrl(i32 %2, i32 %1, i32 %shift)
14 %4 = extractvalue { i32, i32 } %3, 1
15 %5 = zext i32 %4 to i64
17 %7 = extractvalue { i32, i32 } %3, 0
18 %8 = zext i32 %7 to i64
23 declare { i32, i32 } @llvm.arm.mve.asrl(i32, i32, i32)
25 define i64 @test_lsll(i64 %value, i32 %shift) {
26 ; CHECK-LABEL: test_lsll:
27 ; CHECK: @ %bb.0: @ %entry
28 ; CHECK-NEXT: lsll r0, r1, r2
31 %0 = lshr i64 %value, 32
32 %1 = trunc i64 %0 to i32
33 %2 = trunc i64 %value to i32
34 %3 = call { i32, i32 } @llvm.arm.mve.lsll(i32 %2, i32 %1, i32 %shift)
35 %4 = extractvalue { i32, i32 } %3, 1
36 %5 = zext i32 %4 to i64
38 %7 = extractvalue { i32, i32 } %3, 0
39 %8 = zext i32 %7 to i64
44 declare { i32, i32 } @llvm.arm.mve.lsll(i32, i32, i32)
46 define i32 @test_sqrshr(i32 %value, i32 %shift) {
47 ; CHECK-LABEL: test_sqrshr:
48 ; CHECK: @ %bb.0: @ %entry
49 ; CHECK-NEXT: sqrshr r0, r1
52 %0 = call i32 @llvm.arm.mve.sqrshr(i32 %value, i32 %shift)
56 declare i32 @llvm.arm.mve.sqrshr(i32, i32)
58 define i64 @test_sqrshrl(i64 %value, i32 %shift) {
59 ; CHECK-LABEL: test_sqrshrl:
60 ; CHECK: @ %bb.0: @ %entry
61 ; CHECK-NEXT: sqrshrl r0, r1, #64, r2
64 %0 = lshr i64 %value, 32
65 %1 = trunc i64 %0 to i32
66 %2 = trunc i64 %value to i32
67 %3 = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 %2, i32 %1, i32 %shift, i32 64)
68 %4 = extractvalue { i32, i32 } %3, 1
69 %5 = zext i32 %4 to i64
71 %7 = extractvalue { i32, i32 } %3, 0
72 %8 = zext i32 %7 to i64
77 declare { i32, i32 } @llvm.arm.mve.sqrshrl(i32, i32, i32, i32)
79 define i64 @test_sqrshrl_sat48(i64 %value, i32 %shift) {
80 ; CHECK-LABEL: test_sqrshrl_sat48:
81 ; CHECK: @ %bb.0: @ %entry
82 ; CHECK-NEXT: sqrshrl r0, r1, #48, r2
85 %0 = lshr i64 %value, 32
86 %1 = trunc i64 %0 to i32
87 %2 = trunc i64 %value to i32
88 %3 = call { i32, i32 } @llvm.arm.mve.sqrshrl(i32 %2, i32 %1, i32 %shift, i32 48)
89 %4 = extractvalue { i32, i32 } %3, 1
90 %5 = zext i32 %4 to i64
92 %7 = extractvalue { i32, i32 } %3, 0
93 %8 = zext i32 %7 to i64
98 define i32 @test_sqshl(i32 %value) {
99 ; CHECK-LABEL: test_sqshl:
100 ; CHECK: @ %bb.0: @ %entry
101 ; CHECK-NEXT: sqshl r0, #2
104 %0 = call i32 @llvm.arm.mve.sqshl(i32 %value, i32 2)
108 declare i32 @llvm.arm.mve.sqshl(i32, i32)
110 define i64 @test_sqshll(i64 %value) {
111 ; CHECK-LABEL: test_sqshll:
112 ; CHECK: @ %bb.0: @ %entry
113 ; CHECK-NEXT: sqshll r0, r1, #17
116 %0 = lshr i64 %value, 32
117 %1 = trunc i64 %0 to i32
118 %2 = trunc i64 %value to i32
119 %3 = call { i32, i32 } @llvm.arm.mve.sqshll(i32 %2, i32 %1, i32 17)
120 %4 = extractvalue { i32, i32 } %3, 1
121 %5 = zext i32 %4 to i64
123 %7 = extractvalue { i32, i32 } %3, 0
124 %8 = zext i32 %7 to i64
129 declare { i32, i32 } @llvm.arm.mve.sqshll(i32, i32, i32)
131 define i32 @test_srshr(i32 %value) {
132 ; CHECK-LABEL: test_srshr:
133 ; CHECK: @ %bb.0: @ %entry
134 ; CHECK-NEXT: srshr r0, #6
137 %0 = call i32 @llvm.arm.mve.srshr(i32 %value, i32 6)
141 declare i32 @llvm.arm.mve.srshr(i32, i32)
143 define i64 @test_srshrl(i64 %value) {
144 ; CHECK-LABEL: test_srshrl:
145 ; CHECK: @ %bb.0: @ %entry
146 ; CHECK-NEXT: srshrl r0, r1, #26
149 %0 = lshr i64 %value, 32
150 %1 = trunc i64 %0 to i32
151 %2 = trunc i64 %value to i32
152 %3 = call { i32, i32 } @llvm.arm.mve.srshrl(i32 %2, i32 %1, i32 26)
153 %4 = extractvalue { i32, i32 } %3, 1
154 %5 = zext i32 %4 to i64
156 %7 = extractvalue { i32, i32 } %3, 0
157 %8 = zext i32 %7 to i64
162 declare { i32, i32 } @llvm.arm.mve.srshrl(i32, i32, i32)
164 define i32 @test_uqrshl(i32 %value, i32 %shift) {
165 ; CHECK-LABEL: test_uqrshl:
166 ; CHECK: @ %bb.0: @ %entry
167 ; CHECK-NEXT: uqrshl r0, r1
170 %0 = call i32 @llvm.arm.mve.uqrshl(i32 %value, i32 %shift)
174 declare i32 @llvm.arm.mve.uqrshl(i32, i32)
176 define i64 @test_uqrshll(i64 %value, i32 %shift) {
177 ; CHECK-LABEL: test_uqrshll:
178 ; CHECK: @ %bb.0: @ %entry
179 ; CHECK-NEXT: uqrshll r0, r1, #64, r2
182 %0 = lshr i64 %value, 32
183 %1 = trunc i64 %0 to i32
184 %2 = trunc i64 %value to i32
185 %3 = call { i32, i32 } @llvm.arm.mve.uqrshll(i32 %2, i32 %1, i32 %shift, i32 64)
186 %4 = extractvalue { i32, i32 } %3, 1
187 %5 = zext i32 %4 to i64
189 %7 = extractvalue { i32, i32 } %3, 0
190 %8 = zext i32 %7 to i64
195 declare { i32, i32 } @llvm.arm.mve.uqrshll(i32, i32, i32, i32)
197 define i64 @test_uqrshll_sat48(i64 %value, i32 %shift) {
198 ; CHECK-LABEL: test_uqrshll_sat48:
199 ; CHECK: @ %bb.0: @ %entry
200 ; CHECK-NEXT: uqrshll r0, r1, #48, r2
203 %0 = lshr i64 %value, 32
204 %1 = trunc i64 %0 to i32
205 %2 = trunc i64 %value to i32
206 %3 = call { i32, i32 } @llvm.arm.mve.uqrshll(i32 %2, i32 %1, i32 %shift, i32 48)
207 %4 = extractvalue { i32, i32 } %3, 1
208 %5 = zext i32 %4 to i64
210 %7 = extractvalue { i32, i32 } %3, 0
211 %8 = zext i32 %7 to i64
216 define i32 @test_uqshl(i32 %value) {
217 ; CHECK-LABEL: test_uqshl:
218 ; CHECK: @ %bb.0: @ %entry
219 ; CHECK-NEXT: uqshl r0, #21
222 %0 = call i32 @llvm.arm.mve.uqshl(i32 %value, i32 21)
226 declare i32 @llvm.arm.mve.uqshl(i32, i32)
228 define i64 @test_uqshll(i64 %value) {
229 ; CHECK-LABEL: test_uqshll:
230 ; CHECK: @ %bb.0: @ %entry
231 ; CHECK-NEXT: uqshll r0, r1, #16
234 %0 = lshr i64 %value, 32
235 %1 = trunc i64 %0 to i32
236 %2 = trunc i64 %value to i32
237 %3 = call { i32, i32 } @llvm.arm.mve.uqshll(i32 %2, i32 %1, i32 16)
238 %4 = extractvalue { i32, i32 } %3, 1
239 %5 = zext i32 %4 to i64
241 %7 = extractvalue { i32, i32 } %3, 0
242 %8 = zext i32 %7 to i64
247 declare { i32, i32 } @llvm.arm.mve.uqshll(i32, i32, i32)
249 define i32 @test_urshr(i32 %value) {
250 ; CHECK-LABEL: test_urshr:
251 ; CHECK: @ %bb.0: @ %entry
252 ; CHECK-NEXT: urshr r0, #22
255 %0 = call i32 @llvm.arm.mve.urshr(i32 %value, i32 22)
259 declare i32 @llvm.arm.mve.urshr(i32, i32)
261 define i64 @test_urshrl(i64 %value) {
262 ; CHECK-LABEL: test_urshrl:
263 ; CHECK: @ %bb.0: @ %entry
264 ; CHECK-NEXT: urshrl r0, r1, #6
267 %0 = lshr i64 %value, 32
268 %1 = trunc i64 %0 to i32
269 %2 = trunc i64 %value to i32
270 %3 = call { i32, i32 } @llvm.arm.mve.urshrl(i32 %2, i32 %1, i32 6)
271 %4 = extractvalue { i32, i32 } %3, 1
272 %5 = zext i32 %4 to i64
274 %7 = extractvalue { i32, i32 } %3, 0
275 %8 = zext i32 %7 to i64
280 declare { i32, i32 } @llvm.arm.mve.urshrl(i32, i32, i32)