1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -march=hexagon | FileCheck %s
3 ; RUN: llc < %s -march=hexagon -mattr=+hvx,hvx-length64b | FileCheck %s --check-prefix=CHECK-64B
4 ; RUN: llc < %s -march=hexagon -mattr=+hvx,hvx-length128b | FileCheck %s --check-prefix=CHECK-128B
5 define <2 x i32> @test1(<2 x i32> %m) {
7 ; CHECK: .cfi_startproc
8 ; CHECK-NEXT: // %bb.0: // %entry
10 ; CHECK-NEXT: r1 = extract(r1,#8,#0)
11 ; CHECK-NEXT: r0 = sxtb(r0)
12 ; CHECK-NEXT: jumpr r31
15 ; CHECK-64B-LABEL: test1:
16 ; CHECK-64B: .cfi_startproc
17 ; CHECK-64B-NEXT: // %bb.0: // %entry
19 ; CHECK-64B-NEXT: r1 = extract(r1,#8,#0)
20 ; CHECK-64B-NEXT: r0 = sxtb(r0)
21 ; CHECK-64B-NEXT: jumpr r31
24 ; CHECK-128B-LABEL: test1:
25 ; CHECK-128B: .cfi_startproc
26 ; CHECK-128B-NEXT: // %bb.0: // %entry
28 ; CHECK-128B-NEXT: r1 = extract(r1,#8,#0)
29 ; CHECK-128B-NEXT: r0 = sxtb(r0)
30 ; CHECK-128B-NEXT: jumpr r31
33 %shl = shl <2 x i32> %m, <i32 24, i32 24>
34 %shr = ashr exact <2 x i32> %shl, <i32 24, i32 24>
38 define <16 x i32> @test2(<16 x i32> %m) {
40 ; CHECK: .cfi_startproc
41 ; CHECK-NEXT: // %bb.0: // %entry
43 ; CHECK-NEXT: r3 = extract(r3,#8,#0)
44 ; CHECK-NEXT: r29 = add(r29,#-8)
45 ; CHECK-NEXT: r2 = sxtb(r2)
46 ; CHECK-NEXT: r4 = sxtb(r4)
49 ; CHECK-NEXT: r5 = extract(r5,#8,#0)
50 ; CHECK-NEXT: r13:12 = memd(r29+#48)
51 ; CHECK-NEXT: memd(r29+#0) = r17:16
54 ; CHECK-NEXT: r13 = extract(r13,#8,#0)
55 ; CHECK-NEXT: r12 = sxtb(r12)
56 ; CHECK-NEXT: r15:14 = memd(r29+#40)
57 ; CHECK-NEXT: r9:8 = memd(r29+#32)
60 ; CHECK-NEXT: r9 = extract(r9,#8,#0)
61 ; CHECK-NEXT: r8 = sxtb(r8)
62 ; CHECK-NEXT: r11:10 = memd(r29+#24)
63 ; CHECK-NEXT: r7:6 = memd(r29+#16)
66 ; CHECK-NEXT: r11 = extract(r11,#8,#0)
67 ; CHECK-NEXT: r10 = sxtb(r10)
68 ; CHECK-NEXT: r14 = sxtb(r14)
69 ; CHECK-NEXT: r17:16 = memd(r29+#8)
72 ; CHECK-NEXT: r15 = extract(r15,#8,#0)
73 ; CHECK-NEXT: r17 = extract(r17,#8,#0)
74 ; CHECK-NEXT: r16 = sxtb(r16)
75 ; CHECK-NEXT: r6 = sxtb(r6)
78 ; CHECK-NEXT: r7 = extract(r7,#8,#0)
79 ; CHECK-NEXT: memd(r0+#56) = r13:12
80 ; CHECK-NEXT: memd(r0+#48) = r15:14
83 ; CHECK-NEXT: memd(r0+#40) = r9:8
84 ; CHECK-NEXT: memd(r0+#32) = r11:10
87 ; CHECK-NEXT: memd(r0+#24) = r7:6
88 ; CHECK-NEXT: memd(r0+#16) = r17:16
91 ; CHECK-NEXT: memd(r0+#8) = r5:4
92 ; CHECK-NEXT: memd(r0+#0) = r3:2
95 ; CHECK-NEXT: r29 = add(r29,#8)
96 ; CHECK-NEXT: r17:16 = memd(r29+#0)
97 ; CHECK-NEXT: jumpr r31
98 ; CHECK-NEXT: } // 8-byte Folded Reload
100 ; CHECK-64B-LABEL: test2:
101 ; CHECK-64B: .cfi_startproc
102 ; CHECK-64B-NEXT: // %bb.0: // %entry
104 ; CHECK-64B-NEXT: r0 = #24
107 ; CHECK-64B-NEXT: v0.w = vasl(v0.w,r0)
110 ; CHECK-64B-NEXT: v0.w = vasr(v0.w,r0)
111 ; CHECK-64B-NEXT: jumpr r31
114 ; CHECK-128B-LABEL: test2:
115 ; CHECK-128B: .cfi_startproc
116 ; CHECK-128B-NEXT: // %bb.0: // %entry
118 ; CHECK-128B-NEXT: r0 = #24
121 ; CHECK-128B-NEXT: v0.w = vasl(v0.w,r0)
124 ; CHECK-128B-NEXT: v0.w = vasr(v0.w,r0)
125 ; CHECK-128B-NEXT: jumpr r31
128 %shl = shl <16 x i32> %m, <i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24>
129 %shr = ashr exact <16 x i32> %shl, <i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24, i32 24>
133 define <64 x i16> @test3(<64 x i16> %m) {
134 ; CHECK-LABEL: test3:
135 ; CHECK: .cfi_startproc
136 ; CHECK-NEXT: // %bb.0: // %entry
138 ; CHECK-NEXT: r3:2 = vaslh(r3:2,#8)
139 ; CHECK-NEXT: r5:4 = vaslh(r5:4,#8)
140 ; CHECK-NEXT: r9:8 = memd(r29+#96)
141 ; CHECK-NEXT: r11:10 = memd(r29+#88)
144 ; CHECK-NEXT: r9:8 = vaslh(r9:8,#8)
145 ; CHECK-NEXT: r11:10 = vaslh(r11:10,#8)
146 ; CHECK-NEXT: r13:12 = memd(r29+#80)
147 ; CHECK-NEXT: r7:6 = memd(r29+#104)
150 ; CHECK-NEXT: r15:14 = vaslh(r7:6,#8)
151 ; CHECK-NEXT: r13:12 = vaslh(r13:12,#8)
152 ; CHECK-NEXT: r7:6 = memd(r29+#72)
155 ; CHECK-NEXT: r15:14 = vasrh(r15:14,#8)
156 ; CHECK-NEXT: r9:8 = vasrh(r9:8,#8)
159 ; CHECK-NEXT: r11:10 = vasrh(r11:10,#8)
160 ; CHECK-NEXT: r13:12 = vasrh(r13:12,#8)
161 ; CHECK-NEXT: r15:14 = memd(r29+#64)
162 ; CHECK-NEXT: memd(r0+#120) = r15:14
165 ; CHECK-NEXT: r7:6 = vaslh(r7:6,#8)
166 ; CHECK-NEXT: r15:14 = vaslh(r15:14,#8)
167 ; CHECK-NEXT: r9:8 = memd(r29+#56)
168 ; CHECK-NEXT: memd(r0+#112) = r9:8
171 ; CHECK-NEXT: r9:8 = vaslh(r9:8,#8)
172 ; CHECK-NEXT: r7:6 = vasrh(r7:6,#8)
173 ; CHECK-NEXT: r11:10 = memd(r29+#48)
174 ; CHECK-NEXT: memd(r0+#104) = r11:10
177 ; CHECK-NEXT: r11:10 = vaslh(r11:10,#8)
178 ; CHECK-NEXT: r15:14 = vasrh(r15:14,#8)
179 ; CHECK-NEXT: r13:12 = memd(r29+#40)
180 ; CHECK-NEXT: memd(r0+#96) = r13:12
183 ; CHECK-NEXT: r13:12 = vaslh(r13:12,#8)
184 ; CHECK-NEXT: r9:8 = vasrh(r9:8,#8)
185 ; CHECK-NEXT: r7:6 = memd(r29+#32)
186 ; CHECK-NEXT: memd(r0+#88) = r7:6
189 ; CHECK-NEXT: r11:10 = vasrh(r11:10,#8)
190 ; CHECK-NEXT: r13:12 = vasrh(r13:12,#8)
191 ; CHECK-NEXT: r15:14 = memd(r29+#0)
192 ; CHECK-NEXT: memd(r0+#80) = r15:14
195 ; CHECK-NEXT: r7:6 = vaslh(r7:6,#8)
196 ; CHECK-NEXT: r15:14 = vaslh(r15:14,#8)
197 ; CHECK-NEXT: r9:8 = memd(r29+#16)
198 ; CHECK-NEXT: memd(r0+#72) = r9:8
201 ; CHECK-NEXT: r9:8 = vaslh(r9:8,#8)
202 ; CHECK-NEXT: r7:6 = vasrh(r7:6,#8)
203 ; CHECK-NEXT: r11:10 = memd(r29+#24)
204 ; CHECK-NEXT: memd(r0+#64) = r11:10
207 ; CHECK-NEXT: r11:10 = vaslh(r11:10,#8)
208 ; CHECK-NEXT: r3:2 = vasrh(r3:2,#8)
209 ; CHECK-NEXT: r13:12 = memd(r29+#8)
210 ; CHECK-NEXT: memd(r0+#56) = r13:12
213 ; CHECK-NEXT: r13:12 = vaslh(r13:12,#8)
214 ; CHECK-NEXT: r9:8 = vasrh(r9:8,#8)
215 ; CHECK-NEXT: memd(r0+#48) = r7:6
216 ; CHECK-NEXT: memd(r0+#0) = r3:2
219 ; CHECK-NEXT: r11:10 = vasrh(r11:10,#8)
220 ; CHECK-NEXT: r7:6 = vasrh(r15:14,#8)
221 ; CHECK-NEXT: memd(r0+#32) = r9:8
224 ; CHECK-NEXT: r13:12 = vasrh(r13:12,#8)
225 ; CHECK-NEXT: r5:4 = vasrh(r5:4,#8)
226 ; CHECK-NEXT: memd(r0+#40) = r11:10
227 ; CHECK-NEXT: memd(r0+#16) = r7:6
230 ; CHECK-NEXT: jumpr r31
231 ; CHECK-NEXT: memd(r0+#24) = r13:12
232 ; CHECK-NEXT: memd(r0+#8) = r5:4
235 ; CHECK-64B-LABEL: test3:
236 ; CHECK-64B: .cfi_startproc
237 ; CHECK-64B-NEXT: // %bb.0: // %entry
239 ; CHECK-64B-NEXT: r0 = #8
242 ; CHECK-64B-NEXT: v0.h = vasl(v0.h,r0)
245 ; CHECK-64B-NEXT: v1.h = vasl(v1.h,r0)
248 ; CHECK-64B-NEXT: v0.h = vasr(v0.h,r0)
251 ; CHECK-64B-NEXT: v1.h = vasr(v1.h,r0)
252 ; CHECK-64B-NEXT: jumpr r31
255 ; CHECK-128B-LABEL: test3:
256 ; CHECK-128B: .cfi_startproc
257 ; CHECK-128B-NEXT: // %bb.0: // %entry
259 ; CHECK-128B-NEXT: r0 = #8
262 ; CHECK-128B-NEXT: v0.h = vasl(v0.h,r0)
265 ; CHECK-128B-NEXT: v0.h = vasr(v0.h,r0)
266 ; CHECK-128B-NEXT: jumpr r31
269 %shl = shl <64 x i16> %m, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
270 %shr = ashr exact <64 x i16> %shl, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>