1 ; RUN: llc -march=hexagon -O2 -disable-hexagon-shuffle=1 < %s | FileCheck %s
2 ; CHECK: vmemu(r{{[0-9]+}}+#0) = v{{[0-9]*}}
4 target triple = "hexagon"
6 ; Function Attrs: nounwind
7 define void @f0(ptr %a0, i32 %a1, ptr %a2, i32 %a3, ptr %a4) #0 {
9 %v0 = alloca ptr, align 4
10 %v1 = alloca i32, align 4
11 %v2 = alloca ptr, align 4
12 %v3 = alloca i32, align 4
13 %v4 = alloca ptr, align 4
14 %v5 = alloca i32, align 4
15 %v6 = alloca i32, align 4
16 %v7 = alloca i32, align 4
17 %v8 = alloca i32, align 4
18 %v9 = alloca i32, align 4
19 %v10 = alloca <16 x i32>, align 64
20 %v11 = alloca <16 x i32>, align 64
21 %v12 = alloca <16 x i32>, align 64
22 %v13 = alloca <16 x i32>, align 64
23 %v14 = alloca <16 x i32>, align 64
24 %v15 = alloca <16 x i32>, align 64
25 %v16 = alloca <16 x i32>, align 64
26 %v17 = alloca <16 x i32>, align 64
27 %v18 = alloca <16 x i32>, align 64
28 %v19 = alloca <16 x i32>, align 64
29 %v20 = 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 i32 %a3, ptr %v3, align 4
34 store ptr %a4, ptr %v4, align 4
35 %v21 = load i32, ptr %v1, align 4
36 %v22 = ashr i32 %v21, 16
37 %v23 = and i32 65535, %v22
38 store i32 %v23, ptr %v8, align 4
39 %v24 = load i32, ptr %v1, align 4
40 %v25 = and i32 65535, %v24
41 store i32 %v25, ptr %v5, align 4
42 %v26 = load i32, ptr %v3, align 4
43 %v27 = and i32 65535, %v26
44 store i32 %v27, ptr %v6, align 4
45 %v28 = load i32, ptr %v3, align 4
46 %v29 = ashr i32 %v28, 16
47 %v30 = and i32 65535, %v29
48 store i32 %v30, ptr %v9, align 4
49 %v31 = load ptr, ptr %v4, align 4
50 %v33 = load <16 x i32>, ptr %v31, align 64
51 store <16 x i32> %v33, ptr %v10, align 64
52 %v34 = load ptr, ptr %v4, align 4
53 %v35 = getelementptr inbounds i8, ptr %v34, i32 64
54 %v37 = load <16 x i32>, ptr %v35, align 64
55 store <16 x i32> %v37, ptr %v12, align 64
56 %v38 = load i32, ptr %v9, align 4
57 store i32 %v38, ptr %v7, align 4
60 b1: ; preds = %b3, %b0
61 %v39 = load i32, ptr %v7, align 4
62 %v40 = icmp sge i32 %v39, 0
63 br i1 %v40, label %b2, label %b4
66 %v41 = load ptr, ptr %v0, align 4
67 %v43 = load <16 x i32>, ptr %v41, align 4
68 store <16 x i32> %v43, ptr %v14, align 64
69 %v44 = load i32, ptr %v5, align 4
70 %v45 = load ptr, ptr %v0, align 4
71 %v46 = getelementptr inbounds i8, ptr %v45, i32 %v44
72 store ptr %v46, ptr %v0, align 4
73 %v47 = load <16 x i32>, ptr %v14, align 64
74 %v48 = load <16 x i32>, ptr %v10, align 64
75 %v49 = call <16 x i32> @llvm.hexagon.V6.vrdelta(<16 x i32> %v47, <16 x i32> %v48)
76 store <16 x i32> %v49, ptr %v15, align 64
77 %v50 = load <16 x i32>, ptr %v14, align 64
78 %v51 = load <16 x i32>, ptr %v12, align 64
79 %v52 = call <16 x i32> @llvm.hexagon.V6.vrdelta(<16 x i32> %v50, <16 x i32> %v51)
80 store <16 x i32> %v52, ptr %v17, align 64
81 %v53 = load <16 x i32>, ptr %v15, align 64
82 %v54 = load <16 x i32>, ptr %v17, align 64
83 %v55 = call <16 x i32> @llvm.hexagon.V6.vavgub(<16 x i32> %v53, <16 x i32> %v54)
84 store <16 x i32> %v55, ptr %v19, align 64
85 %v56 = load ptr, ptr %v2, align 4
86 %v57 = load <16 x i32>, ptr %v19, align 64
87 call void asm sideeffect " vmemu($0) = $1;\0A", "r,v,~{memory}"(ptr %v56, <16 x i32> %v57) #2, !srcloc !0
91 %v58 = load i32, ptr %v6, align 4
92 %v59 = load i32, ptr %v7, align 4
93 %v60 = sub nsw i32 %v59, %v58
94 store i32 %v60, ptr %v7, align 4
101 ; Function Attrs: nounwind readnone
102 declare <16 x i32> @llvm.hexagon.V6.vrdelta(<16 x i32>, <16 x i32>) #1
104 ; Function Attrs: nounwind readnone
105 declare <16 x i32> @llvm.hexagon.V6.vavgub(<16 x i32>, <16 x i32>) #1
107 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
108 attributes #1 = { nounwind readnone }
109 attributes #2 = { nounwind }