1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 define i64 @f0(ptr %a0, <8 x i8> %a1) #0 {
6 ; CHECK: // %bb.0: // %b0
8 ; CHECK-NEXT: r0 = memub(r0+#0)
11 ; CHECK-NEXT: r5:4 = combine(#0,#0)
17 ; CHECK-NEXT: r1:0 = vmux(p0,r3:2,r5:4)
20 ; CHECK-NEXT: jumpr r31
23 %v0 = load <8 x i1>, ptr %a0, align 1
24 %v1 = select <8 x i1> %v0, <8 x i8> %a1, <8 x i8> zeroinitializer
25 %v2 = bitcast <8 x i8> %v1 to i64
29 define i32 @f1(ptr %a0, <4 x i8> %a1) #0 {
31 ; CHECK: // %bb.0: // %b0
33 ; CHECK-NEXT: r0 = memub(r0+#0)
36 ; CHECK-NEXT: r3:2 = combine(#0,#0)
39 ; CHECK-NEXT: r5:4 = vzxtbh(r1)
45 ; CHECK-NEXT: r1:0 = vmux(p0,r5:4,r3:2)
48 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
51 ; CHECK-NEXT: jumpr r31
54 %v0 = load <4 x i1>, ptr %a0, align 1
55 %v1 = select <4 x i1> %v0, <4 x i8> %a1, <4 x i8> zeroinitializer
56 %v2 = bitcast <4 x i8> %v1 to i32
60 define i16 @f2(ptr %a0, <2 x i8> %a1) #0 {
62 ; CHECK: // %bb.0: // %b0
64 ; CHECK-NEXT: r0 = memub(r0+#0)
67 ; CHECK-NEXT: p1 = tstbit(r0,#4)
73 ; CHECK-NEXT: r1 = mux(p1,r3,#0)
76 ; CHECK-NEXT: r0 = mux(p0,r2,#0)
79 ; CHECK-NEXT: r0 = insert(r1,#24,#8)
82 ; CHECK-NEXT: jumpr r31
85 %v0 = load <2 x i1>, ptr %a0, align 1
86 %v1 = select <2 x i1> %v0, <2 x i8> %a1, <2 x i8> zeroinitializer
87 %v2 = bitcast <2 x i8> %v1 to i16
91 define i8 @f3(ptr %a0, <1 x i8> %a1) #0 {
93 ; CHECK: // %bb.0: // %b0
95 ; CHECK-NEXT: r0 = memub(r0+#0)
101 ; CHECK-NEXT: r0 = mux(p0,r1,#0)
104 ; CHECK-NEXT: jumpr r31
107 %v0 = load <1 x i1>, ptr %a0, align 1
108 %v1 = select <1 x i1> %v0, <1 x i8> %a1, <1 x i8> zeroinitializer
109 %v2 = bitcast <1 x i8> %v1 to i8
113 define void @f4(ptr %a0, i64 %a1) #0 {
115 ; CHECK: // %bb.0: // %b0
117 ; CHECK-NEXT: r5:4 = combine(#0,#0)
120 ; CHECK-NEXT: p0 = vcmpb.eq(r3:2,r5:4)
123 ; CHECK-NEXT: p0 = not(p0)
126 ; CHECK-NEXT: r1 = p0
129 ; CHECK-NEXT: memb(r0+#0) = r1
132 ; CHECK-NEXT: jumpr r31
135 %v0 = bitcast i64 %a1 to <8 x i8>
136 %v1 = icmp ne <8 x i8> %v0, zeroinitializer
137 store <8 x i1> %v1, ptr %a0, align 1
141 define void @f5(ptr %a0, i32 %a1) #0 {
143 ; CHECK: // %bb.0: // %b0
145 ; CHECK-NEXT: r3:2 = vsxtbh(r1)
148 ; CHECK-NEXT: r5:4 = combine(#0,#0)
151 ; CHECK-NEXT: p0 = vcmph.eq(r3:2,r5:4)
154 ; CHECK-NEXT: p0 = not(p0)
157 ; CHECK-NEXT: r2 = p0
160 ; CHECK-NEXT: memb(r0+#0) = r2
163 ; CHECK-NEXT: jumpr r31
166 %v0 = bitcast i32 %a1 to <4 x i8>
167 %v1 = icmp ne <4 x i8> %v0, zeroinitializer
168 store <4 x i1> %v1, ptr %a0, align 1
172 define void @f6(ptr %a0, i16 %a1) #0 {
174 ; CHECK: // %bb.0: // %b0
176 ; CHECK-NEXT: r2 = extractu(r1,#8,#8)
179 ; CHECK-NEXT: r3 = #255
182 ; CHECK-NEXT: p1 = !bitsclr(r1,r3)
185 ; CHECK-NEXT: p0 = cmp.eq(r2,#0)
188 ; CHECK-NEXT: if (p0) r2 = #0
191 ; CHECK-NEXT: r1 = mux(p1,#8,#0)
194 ; CHECK-NEXT: r3 = mux(p1,#2,#0)
197 ; CHECK-NEXT: r5 = setbit(r1,#2)
200 ; CHECK-NEXT: r6 = setbit(r3,#0)
203 ; CHECK-NEXT: if (!p0) r2 = #128
206 ; CHECK-NEXT: r4 = mux(p0,#0,#32)
209 ; CHECK-NEXT: if (!p1) r5 = add(r1,#0)
212 ; CHECK-NEXT: if (!p1) r6 = add(r3,#0)
215 ; CHECK-NEXT: r1 = setbit(r2,#6)
218 ; CHECK-NEXT: r3 = setbit(r4,#4)
221 ; CHECK-NEXT: r5 = or(r6,r5)
224 ; CHECK-NEXT: if (!p0) r2 = add(r1,#0)
227 ; CHECK-NEXT: if (!p0) r4 = add(r3,#0)
230 ; CHECK-NEXT: r5 |= or(r4,r2)
233 ; CHECK-NEXT: memb(r0+#0) = r5
236 ; CHECK-NEXT: jumpr r31
239 %v0 = bitcast i16 %a1 to <2 x i8>
240 %v1 = icmp ne <2 x i8> %v0, zeroinitializer
241 store <2 x i1> %v1, ptr %a0, align 1
245 define void @f7(ptr %a0, i8 %a1) #0 {
247 ; CHECK: // %bb.0: // %b0
249 ; CHECK-NEXT: r2 = #255
252 ; CHECK-NEXT: p0 = !bitsclr(r1,r2)
255 ; CHECK-NEXT: r1 = mux(p0,#1,#0)
258 ; CHECK-NEXT: memb(r0+#0) = r1
261 ; CHECK-NEXT: jumpr r31
264 %v0 = bitcast i8 %a1 to <1 x i8>
265 %v1 = icmp ne <1 x i8> %v0, zeroinitializer
266 store <1 x i1> %v1, ptr %a0, align 1
270 attributes #0 = { nounwind "target-features"="-packets" }