1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
; RUN: llvm-as < %s | llc -march=systemz | FileCheck %s
define i32 @foo1(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo1:
; CHECK: a %r2, 4(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = add i32 %a, %c
ret i32 %d
}
define i32 @foo2(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo2:
; CHECK: ay %r2, -4(%r1,%r3)
entry:
%idx2 = add i64 %idx, -1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = add i32 %a, %c
ret i32 %d
}
define i64 @foo3(i64 %a, i64 *%b, i64 %idx) signext {
; CHECK: foo3:
; CHECK: ag %r2, 8(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i64* %b, i64 %idx2 ; <i64*> [#uses=1]
%c = load i64* %ptr
%d = add i64 %a, %c
ret i64 %d
}
define i32 @foo4(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo4:
; CHECK: n %r2, 4(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = and i32 %a, %c
ret i32 %d
}
define i32 @foo5(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo5:
; CHECK: ny %r2, -4(%r1,%r3)
entry:
%idx2 = add i64 %idx, -1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = and i32 %a, %c
ret i32 %d
}
define i64 @foo6(i64 %a, i64 *%b, i64 %idx) signext {
; CHECK: foo6:
; CHECK: ng %r2, 8(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i64* %b, i64 %idx2 ; <i64*> [#uses=1]
%c = load i64* %ptr
%d = and i64 %a, %c
ret i64 %d
}
define i32 @foo7(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo7:
; CHECK: o %r2, 4(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = or i32 %a, %c
ret i32 %d
}
define i32 @foo8(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo8:
; CHECK: oy %r2, -4(%r1,%r3)
entry:
%idx2 = add i64 %idx, -1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = or i32 %a, %c
ret i32 %d
}
define i64 @foo9(i64 %a, i64 *%b, i64 %idx) signext {
; CHECK: foo9:
; CHECK: og %r2, 8(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i64* %b, i64 %idx2 ; <i64*> [#uses=1]
%c = load i64* %ptr
%d = or i64 %a, %c
ret i64 %d
}
define i32 @foo10(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo10:
; CHECK: x %r2, 4(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = xor i32 %a, %c
ret i32 %d
}
define i32 @foo11(i32 %a, i32 *%b, i64 %idx) signext {
; CHECK: foo11:
; CHECK: xy %r2, -4(%r1,%r3)
entry:
%idx2 = add i64 %idx, -1 ; <i64> [#uses=1]
%ptr = getelementptr i32* %b, i64 %idx2 ; <i32*> [#uses=1]
%c = load i32* %ptr
%d = xor i32 %a, %c
ret i32 %d
}
define i64 @foo12(i64 %a, i64 *%b, i64 %idx) signext {
; CHECK: foo12:
; CHECK: xg %r2, 8(%r1,%r3)
entry:
%idx2 = add i64 %idx, 1 ; <i64> [#uses=1]
%ptr = getelementptr i64* %b, i64 %idx2 ; <i64*> [#uses=1]
%c = load i64* %ptr
%d = xor i64 %a, %c
ret i64 %d
}
|