1 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
2 ; Looking for 3rd register field to be restricted to r0-r7.
4 ; CHECK: v{{[0-9]+}}:{{[0-9]+}} = vdeal(v{{[0-9]+}},v{{[0-9]+}},r{{[0-7]+}})
6 target triple = "hexagon"
8 ; Function Attrs: nounwind
9 define void @f0(ptr %a0, i32 %a1, ptr %a2, ptr %a3) #0 {
11 %v0 = alloca ptr, align 4
12 %v1 = alloca i32, align 4
13 %v2 = alloca ptr, align 4
14 %v3 = alloca ptr, align 4
15 %v4 = alloca i32, align 4
16 %v5 = alloca i32, align 4
17 %v6 = alloca i32, align 4
18 %v7 = alloca i32, align 4
19 %v8 = alloca i32, align 4
20 %v9 = alloca ptr, align 4
21 %v10 = alloca ptr, align 4
22 %v11 = alloca <16 x i32>, align 64
23 %v12 = alloca <16 x i32>, align 64
24 %v13 = alloca <32 x i32>, align 128
25 %v14 = alloca <16 x i32>, align 64
26 %v15 = alloca <16 x i32>, align 64
27 %v16 = alloca <32 x i32>, align 128
28 %v17 = alloca <16 x i32>, align 64
29 %v18 = alloca <16 x i32>, align 64
30 store ptr %a0, ptr %v0, align 4
31 store i32 %a1, ptr %v1, align 4
32 store ptr %a2, ptr %v2, align 4
33 store ptr %a3, ptr %v3, align 4
34 %v19 = load ptr, ptr %v2, align 4
35 %v20 = getelementptr inbounds i8, ptr %v19, i32 192
36 %v22 = load <16 x i32>, ptr %v20, align 64
37 store <16 x i32> %v22, ptr %v12, align 64
38 store i32 16843009, ptr %v4, align 4
39 %v23 = load i32, ptr %v4, align 4
40 %v24 = load i32, ptr %v4, align 4
41 %v25 = add nsw i32 %v23, %v24
42 store i32 %v25, ptr %v5, align 4
43 %v26 = load i32, ptr %v5, align 4
44 %v27 = load i32, ptr %v5, align 4
45 %v28 = add nsw i32 %v26, %v27
46 store i32 %v28, ptr %v6, align 4
47 %v29 = load ptr, ptr %v0, align 4
48 store ptr %v29, ptr %v9, align 4
49 %v30 = load ptr, ptr %v3, align 4
50 store ptr %v30, ptr %v10, align 4
51 store i32 0, ptr %v8, align 4
54 b1: ; preds = %b3, %b0
55 %v31 = load i32, ptr %v8, align 4
56 %v32 = load i32, ptr %v1, align 4
57 %v33 = icmp slt i32 %v31, %v32
58 br i1 %v33, label %b2, label %b4
61 %v34 = load <16 x i32>, ptr %v11, align 64
62 %v35 = tail call <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32> %v34, i32 -1)
63 %v36 = load <16 x i32>, ptr %v14, align 64
64 %v37 = load <16 x i32>, ptr %v15, align 64
65 %v38 = call <32 x i32> @llvm.hexagon.V6.vswap(<64 x i1> %v35, <16 x i32> %v36, <16 x i32> %v37)
66 store <32 x i32> %v38, ptr %v13, align 128
67 %v39 = load <32 x i32>, ptr %v13, align 128
68 %v40 = call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v39)
69 store <16 x i32> %v40, ptr %v14, align 64
70 %v41 = load <32 x i32>, ptr %v13, align 128
71 %v42 = call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v41)
72 store <16 x i32> %v42, ptr %v15, align 64
73 %v43 = load <16 x i32>, ptr %v17, align 64
74 %v44 = load <16 x i32>, ptr %v18, align 64
75 %v45 = load i32, ptr %v7, align 4
76 %v46 = call <32 x i32> @llvm.hexagon.V6.vdealvdd(<16 x i32> %v43, <16 x i32> %v44, i32 %v45)
77 store <32 x i32> %v46, ptr %v16, align 128
81 %v47 = load i32, ptr %v8, align 4
82 %v48 = add nsw i32 %v47, 1
83 store i32 %v48, ptr %v8, align 4
90 ; Function Attrs: nounwind readnone
91 declare <32 x i32> @llvm.hexagon.V6.vswap(<64 x i1>, <16 x i32>, <16 x i32>) #1
93 ; Function Attrs: nounwind readnone
94 declare <16 x i32> @llvm.hexagon.V6.hi(<32 x i32>) #1
96 ; Function Attrs: nounwind readnone
97 declare <16 x i32> @llvm.hexagon.V6.lo(<32 x i32>) #1
99 ; Function Attrs: nounwind readnone
100 declare <32 x i32> @llvm.hexagon.V6.vdealvdd(<16 x i32>, <16 x i32>, i32) #1
102 ; Function Attrs: nounwind readnone
103 declare <64 x i1> @llvm.hexagon.V6.vandvrt(<16 x i32>, i32) #1
105 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
106 attributes #1 = { nounwind readnone }