1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 ; Splat immediate, 8-bit, v60
5 define <128 x i8> @f0() #0 {
9 ; CHECK-NEXT: r0 = ##2139062143
12 ; CHECK-NEXT: v0 = vsplat(r0)
13 ; CHECK-NEXT: jumpr r31
15 %v0 = insertelement <128 x i8> undef, i8 127, i32 0
16 %v1 = shufflevector <128 x i8> %v0, <128 x i8> undef, <128 x i32> zeroinitializer
20 ; Splat immediate, 16 bit, v60
21 define <64 x i16> @f1() #0 {
25 ; CHECK-NEXT: r0 = ##-1437226411
28 ; CHECK-NEXT: v0 = vsplat(r0)
29 ; CHECK-NEXT: jumpr r31
31 %v0 = insertelement <64 x i16> undef, i16 43605, i32 0
32 %v1 = shufflevector <64 x i16> %v0, <64 x i16> undef, <64 x i32> zeroinitializer
36 ; Splat immediate, 32 bit, v60
37 define <32 x i32> @f2() #0 {
41 ; CHECK-NEXT: r0 = ##134744072
44 ; CHECK-NEXT: v0 = vsplat(r0)
45 ; CHECK-NEXT: jumpr r31
47 %v0 = insertelement <32 x i32> undef, i32 134744072, i32 0
48 %v1 = shufflevector <32 x i32> %v0, <32 x i32> undef, <32 x i32> zeroinitializer
52 ; Splat immediate, 8-bit, v62+
53 define <128 x i8> @f3() #1 {
57 ; CHECK-NEXT: r0 = #127
60 ; CHECK-NEXT: v0.b = vsplat(r0)
61 ; CHECK-NEXT: jumpr r31
63 %v0 = insertelement <128 x i8> undef, i8 127, i32 0
64 %v1 = shufflevector <128 x i8> %v0, <128 x i8> undef, <128 x i32> zeroinitializer
68 ; Splat immediate, 16 bit, v62+
69 define <64 x i16> @f4() #1 {
73 ; CHECK-NEXT: r0 = #-21931
76 ; CHECK-NEXT: v0.h = vsplat(r0)
77 ; CHECK-NEXT: jumpr r31
79 %v0 = insertelement <64 x i16> undef, i16 43605, i32 0
80 %v1 = shufflevector <64 x i16> %v0, <64 x i16> undef, <64 x i32> zeroinitializer
84 ; Splat immediate, 32 bit, v62+
85 define <32 x i32> @f5() #1 {
89 ; CHECK-NEXT: r0 = ##134744072
92 ; CHECK-NEXT: v0 = vsplat(r0)
93 ; CHECK-NEXT: jumpr r31
95 %v0 = insertelement <32 x i32> undef, i32 134744072, i32 0
96 %v1 = shufflevector <32 x i32> %v0, <32 x i32> undef, <32 x i32> zeroinitializer
100 ; Splat register, 8-bit, v60
101 define <128 x i8> @f6(i8 %a0) #0 {
105 ; CHECK-NEXT: r0 = vsplatb(r0)
108 ; CHECK-NEXT: v0 = vsplat(r0)
109 ; CHECK-NEXT: jumpr r31
111 %v0 = insertelement <128 x i8> undef, i8 %a0, i32 0
112 %v1 = shufflevector <128 x i8> %v0, <128 x i8> undef, <128 x i32> zeroinitializer
116 ; Splat register, 16 bit, v60
117 define <64 x i16> @f7(i16 %a0) #0 {
121 ; CHECK-NEXT: r0 = combine(r0.l,r0.l)
124 ; CHECK-NEXT: v0 = vsplat(r0)
125 ; CHECK-NEXT: jumpr r31
127 %v0 = insertelement <64 x i16> undef, i16 %a0, i32 0
128 %v1 = shufflevector <64 x i16> %v0, <64 x i16> undef, <64 x i32> zeroinitializer
132 ; Splat register, 32 bit, v60
133 define <32 x i32> @f8(i32 %a0) #0 {
137 ; CHECK-NEXT: v0 = vsplat(r0)
138 ; CHECK-NEXT: jumpr r31
140 %v0 = insertelement <32 x i32> undef, i32 %a0, i32 0
141 %v1 = shufflevector <32 x i32> %v0, <32 x i32> undef, <32 x i32> zeroinitializer
145 ; Splat register, 8-bit, v62+
146 define <128 x i8> @f9(i8 %a0) #1 {
150 ; CHECK-NEXT: v0.b = vsplat(r0)
151 ; CHECK-NEXT: jumpr r31
153 %v0 = insertelement <128 x i8> undef, i8 %a0, i32 0
154 %v1 = shufflevector <128 x i8> %v0, <128 x i8> undef, <128 x i32> zeroinitializer
158 ; Splat register, 16 bit, v62+
159 define <64 x i16> @f10(i16 %a0) #1 {
163 ; CHECK-NEXT: v0.h = vsplat(r0)
164 ; CHECK-NEXT: jumpr r31
166 %v0 = insertelement <64 x i16> undef, i16 %a0, i32 0
167 %v1 = shufflevector <64 x i16> %v0, <64 x i16> undef, <64 x i32> zeroinitializer
171 ; Splat register, 32 bit, v62+
172 define <32 x i32> @f11(i32 %a0) #1 {
176 ; CHECK-NEXT: v0 = vsplat(r0)
177 ; CHECK-NEXT: jumpr r31
179 %v0 = insertelement <32 x i32> undef, i32 %a0, i32 0
180 %v1 = shufflevector <32 x i32> %v0, <32 x i32> undef, <32 x i32> zeroinitializer
184 ; Splat immediate, 8-bit, v60, pair
185 define <256 x i8> @f12() #0 {
189 ; CHECK-NEXT: r0 = ##2139062143
192 ; CHECK-NEXT: v1 = vsplat(r0)
195 ; CHECK-NEXT: v0 = v1
196 ; CHECK-NEXT: jumpr r31
198 %v0 = insertelement <256 x i8> undef, i8 127, i32 0
199 %v1 = shufflevector <256 x i8> %v0, <256 x i8> undef, <256 x i32> zeroinitializer
203 ; Splat immediate, 16 bit, v60, pair
204 define <128 x i16> @f13() #0 {
208 ; CHECK-NEXT: r0 = ##-1437226411
211 ; CHECK-NEXT: v1 = vsplat(r0)
214 ; CHECK-NEXT: v0 = v1
215 ; CHECK-NEXT: jumpr r31
217 %v0 = insertelement <128 x i16> undef, i16 43605, i32 0
218 %v1 = shufflevector <128 x i16> %v0, <128 x i16> undef, <128 x i32> zeroinitializer
222 ; Splat immediate, 32 bit, v60, pair
223 define <64 x i32> @f14() #0 {
227 ; CHECK-NEXT: r0 = ##134744072
230 ; CHECK-NEXT: v1 = vsplat(r0)
233 ; CHECK-NEXT: v0 = v1
234 ; CHECK-NEXT: jumpr r31
236 %v0 = insertelement <64 x i32> undef, i32 134744072, i32 0
237 %v1 = shufflevector <64 x i32> %v0, <64 x i32> undef, <64 x i32> zeroinitializer
241 ; Splat immediate, 8-bit, v62+, pair
242 define <256 x i8> @f15() #1 {
246 ; CHECK-NEXT: r0 = #127
249 ; CHECK-NEXT: v1.b = vsplat(r0)
252 ; CHECK-NEXT: v0 = v1
253 ; CHECK-NEXT: jumpr r31
255 %v0 = insertelement <256 x i8> undef, i8 127, i32 0
256 %v1 = shufflevector <256 x i8> %v0, <256 x i8> undef, <256 x i32> zeroinitializer
260 ; Splat immediate, 16 bit, v62+, pair
261 define <128 x i16> @f16() #1 {
265 ; CHECK-NEXT: r0 = #-21931
268 ; CHECK-NEXT: v1.h = vsplat(r0)
271 ; CHECK-NEXT: v0 = v1
272 ; CHECK-NEXT: jumpr r31
274 %v0 = insertelement <128 x i16> undef, i16 43605, i32 0
275 %v1 = shufflevector <128 x i16> %v0, <128 x i16> undef, <128 x i32> zeroinitializer
279 ; Splat immediate, 32 bit, v62+, pair
280 define <64 x i32> @f17() #1 {
284 ; CHECK-NEXT: r0 = ##134744072
287 ; CHECK-NEXT: v1 = vsplat(r0)
290 ; CHECK-NEXT: v0 = v1
291 ; CHECK-NEXT: jumpr r31
293 %v0 = insertelement <64 x i32> undef, i32 134744072, i32 0
294 %v1 = shufflevector <64 x i32> %v0, <64 x i32> undef, <64 x i32> zeroinitializer
298 ; Splat register, 8-bit, v60, pair
299 define <256 x i8> @f18(i8 %a0) #0 {
303 ; CHECK-NEXT: r0 = vsplatb(r0)
306 ; CHECK-NEXT: v1 = vsplat(r0)
309 ; CHECK-NEXT: v0 = v1
310 ; CHECK-NEXT: jumpr r31
312 %v0 = insertelement <256 x i8> undef, i8 %a0, i32 0
313 %v1 = shufflevector <256 x i8> %v0, <256 x i8> undef, <256 x i32> zeroinitializer
317 ; Splat register, 16 bit, v60, pair
318 define <128 x i16> @f19(i16 %a0) #0 {
322 ; CHECK-NEXT: r0 = combine(r0.l,r0.l)
325 ; CHECK-NEXT: v1 = vsplat(r0)
328 ; CHECK-NEXT: v0 = v1
329 ; CHECK-NEXT: jumpr r31
331 %v0 = insertelement <128 x i16> undef, i16 %a0, i32 0
332 %v1 = shufflevector <128 x i16> %v0, <128 x i16> undef, <128 x i32> zeroinitializer
336 ; Splat register, 32 bit, v60, pair
337 define <64 x i32> @f20(i32 %a0) #0 {
341 ; CHECK-NEXT: v1 = vsplat(r0)
344 ; CHECK-NEXT: v0 = v1
345 ; CHECK-NEXT: jumpr r31
347 %v0 = insertelement <64 x i32> undef, i32 %a0, i32 0
348 %v1 = shufflevector <64 x i32> %v0, <64 x i32> undef, <64 x i32> zeroinitializer
352 ; Splat register, 8-bit, v62+, pair
353 define <256 x i8> @f21(i8 %a0) #1 {
357 ; CHECK-NEXT: v1.b = vsplat(r0)
360 ; CHECK-NEXT: v0 = v1
361 ; CHECK-NEXT: jumpr r31
363 %v0 = insertelement <256 x i8> undef, i8 %a0, i32 0
364 %v1 = shufflevector <256 x i8> %v0, <256 x i8> undef, <256 x i32> zeroinitializer
368 ; Splat register, 16 bit, v62+, pair
369 define <128 x i16> @f22(i16 %a0) #1 {
373 ; CHECK-NEXT: v1.h = vsplat(r0)
376 ; CHECK-NEXT: v0 = v1
377 ; CHECK-NEXT: jumpr r31
379 %v0 = insertelement <128 x i16> undef, i16 %a0, i32 0
380 %v1 = shufflevector <128 x i16> %v0, <128 x i16> undef, <128 x i32> zeroinitializer
384 ; Splat register, 32 bit, v62+, pair
385 define <64 x i32> @f23(i32 %a0) #1 {
389 ; CHECK-NEXT: v1 = vsplat(r0)
392 ; CHECK-NEXT: v0 = v1
393 ; CHECK-NEXT: jumpr r31
395 %v0 = insertelement <64 x i32> undef, i32 %a0, i32 0
396 %v1 = shufflevector <64 x i32> %v0, <64 x i32> undef, <64 x i32> zeroinitializer
400 ; Splat register, 16 bit fp, v68+
401 define <64 x half> @f24(i16 %a0) #2 {
405 ; CHECK-NEXT: v0.h = vsplat(r0)
406 ; CHECK-NEXT: jumpr r31
408 %v0 = bitcast i16 %a0 to half
409 %v1 = insertelement <64 x half> undef, half %v0, i32 0
410 %v2 = shufflevector <64 x half> %v1, <64 x half> undef, <64 x i32> zeroinitializer
414 ; Splat register, 32 bit fp, v68+
415 define <32 x float> @f25(float %a0) #2 {
419 ; CHECK-NEXT: v0 = vsplat(r0)
420 ; CHECK-NEXT: jumpr r31
422 %v0 = insertelement <32 x float> undef, float %a0, i32 0
423 %v1 = shufflevector <32 x float> %v0, <32 x float> undef, <32 x i32> zeroinitializer
428 attributes #0 = { nounwind readnone "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length128b" }
429 attributes #1 = { nounwind readnone "target-cpu"="hexagonv62" "target-features"="+hvxv62,+hvx-length128b" }
430 attributes #2 = { nounwind readnone "target-cpu"="hexagonv69" "target-features"="+hvxv69,+hvx-length128b,+hvx-qfloat" }