annotate test/CodeGen/Hexagon/mul64-sext.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: llc -march=hexagon < %s | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 target triple = "hexagon-unknown--elf"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; CHECK-LABEL: mul_1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; CHECK: r1:0 = mpy(r2,r0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 define i64 @mul_1(i64 %a0, i64 %a1) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 b2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 %v3 = shl i64 %a0, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 %v4 = ashr exact i64 %v3, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 %v5 = shl i64 %a1, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 %v6 = ashr exact i64 %v5, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 %v7 = mul nsw i64 %v6, %v4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ret i64 %v7
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; CHECK-LABEL: mul_2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; CHECK: r0 = memb(r0+#0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ; CHECK: r1:0 = mpy(r2,r0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; CHECK: jumpr r31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 define i64 @mul_2(i8* %a0, i64 %a1) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 b2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 %v3 = load i8, i8* %a0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 %v4 = sext i8 %v3 to i64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 %v5 = shl i64 %a1, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 %v6 = ashr exact i64 %v5, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 %v7 = mul nsw i64 %v6, %v4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ret i64 %v7
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; CHECK-LABEL: mul_acc_1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ; CHECK: r5:4 += mpy(r2,r0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 ; CHECK: r1:0 = combine(r5,r4)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 ; CHECK: jumpr r31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 define i64 @mul_acc_1(i64 %a0, i64 %a1, i64 %a2) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 b3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 %v4 = shl i64 %a0, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 %v5 = ashr exact i64 %v4, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 %v6 = shl i64 %a1, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 %v7 = ashr exact i64 %v6, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 %v8 = mul nsw i64 %v7, %v5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 %v9 = add i64 %a2, %v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ret i64 %v9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ; CHECK-LABEL: mul_acc_2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; CHECK: r2 = memw(r2+#0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 ; CHECK: r5:4 += mpy(r2,r0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ; CHECK: r1:0 = combine(r5,r4)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 ; CHECK: jumpr r31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 define i64 @mul_acc_2(i64 %a0, i32* %a1, i64 %a2) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 b3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 %v4 = shl i64 %a0, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 %v5 = ashr exact i64 %v4, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 %v6 = load i32, i32* %a1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 %v7 = sext i32 %v6 to i64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 %v8 = mul nsw i64 %v7, %v5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 %v9 = add i64 %a2, %v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 ret i64 %v9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 ; CHECK-LABEL: mul_nac_1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ; CHECK: r5:4 -= mpy(r2,r0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 ; CHECK: r1:0 = combine(r5,r4)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 ; CHECK: jumpr r31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 define i64 @mul_nac_1(i64 %a0, i64 %a1, i64 %a2) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 b3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 %v4 = shl i64 %a0, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 %v5 = ashr exact i64 %v4, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 %v6 = shl i64 %a1, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 %v7 = ashr exact i64 %v6, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 %v8 = mul nsw i64 %v7, %v5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 %v9 = sub i64 %a2, %v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 ret i64 %v9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 ; CHECK-LABEL: mul_nac_2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 ; CHECK: r0 = memw(r0+#0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 ; CHECK: r5:4 -= mpy(r2,r0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 ; CHECK: r1:0 = combine(r5,r4)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 ; CHECK: jumpr r31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 define i64 @mul_nac_2(i32* %a0, i64 %a1, i64 %a2) #0 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 b3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 %v4 = load i32, i32* %a0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 %v5 = sext i32 %v4 to i64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 %v6 = shl i64 %a1, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 %v7 = ashr exact i64 %v6, 32
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 %v8 = mul nsw i64 %v7, %v5
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 %v9 = sub i64 %a2, %v8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 ret i64 %v9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 attributes #0 = { nounwind }