1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 ; Test that we compile the HVX dual output intrinsics.
6 define inreg <16 x i32> @f0(<16 x i32> %a0, <16 x i32> %a1, ptr %a2) #0 {
8 ; CHECK: // %bb.0: // %b0
10 ; CHECK-NEXT: r1 = #-1
11 ; CHECK-NEXT: v2 = vmem(r0+#0)
14 ; CHECK-NEXT: q0 = vand(v2,r1)
17 ; CHECK-NEXT: v0.w = vadd(v0.w,v1.w,q0):carry
18 ; CHECK-NEXT: jumpr r31
21 %v0 = load <16 x i32>, ptr %a2, align 64
22 %v1 = tail call <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32> %v0, i32 -1)
23 %v2 = tail call { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vaddcarry(<16 x i32> %a0, <16 x i32> %a1, <64 x i1> %v1)
24 %v3 = extractvalue { <16 x i32>, <64 x i1> } %v2, 0
28 define inreg <16 x i32> @f1(<16 x i32> %a0, <16 x i32> %a1, ptr %a2) #0 {
30 ; CHECK: // %bb.0: // %b0
32 ; CHECK-NEXT: r1 = #-1
33 ; CHECK-NEXT: v2 = vmem(r0+#0)
36 ; CHECK-NEXT: q0 = vand(v2,r1)
39 ; CHECK-NEXT: v0.w = vsub(v0.w,v1.w,q0):carry
40 ; CHECK-NEXT: jumpr r31
43 %v0 = load <16 x i32>, ptr %a2, align 64
44 %v1 = tail call <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32> %v0, i32 -1)
45 %v2 = tail call { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vsubcarry(<16 x i32> %a0, <16 x i32> %a1, <64 x i1> %v1)
46 %v3 = extractvalue { <16 x i32>, <64 x i1> } %v2, 0
50 define inreg <16 x i32> @f2(<16 x i32> %a0, <16 x i32> %a1) #0 {
52 ; CHECK: // %bb.0: // %b0
54 ; CHECK-NEXT: v0.w,q0 = vadd(v0.w,v1.w):carry
55 ; CHECK-NEXT: jumpr r31
58 %v0 = tail call { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vaddcarryo(<16 x i32> %a0, <16 x i32> %a1)
59 %v1 = extractvalue { <16 x i32>, <64 x i1> } %v0, 0
63 define inreg <16 x i32> @f3(<16 x i32> %a0, <16 x i32> %a1) #0 {
65 ; CHECK: // %bb.0: // %b0
67 ; CHECK-NEXT: v0.w,q0 = vsub(v0.w,v1.w):carry
68 ; CHECK-NEXT: jumpr r31
71 %v0 = tail call { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vsubcarryo(<16 x i32> %a0, <16 x i32> %a1)
72 %v1 = extractvalue { <16 x i32>, <64 x i1> } %v0, 0
76 declare { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vaddcarry(<16 x i32>, <16 x i32>, <64 x i1>) #1
77 declare { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vsubcarry(<16 x i32>, <16 x i32>, <64 x i1>) #1
78 declare { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vaddcarryo(<16 x i32>, <16 x i32>) #1
79 declare { <16 x i32>, <64 x i1> } @llvm.hexagon.V6.vsubcarryo(<16 x i32>, <16 x i32>) #1
81 declare <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32>, i32) #1
83 attributes #0 = { nounwind "target-cpu"="hexagonv66" "target-features"="+hvxv66,+hvx-length64b" }
84 attributes #1 = { nounwind readnone }