summaryrefslogtreecommitdiff
path: root/test/CodeGen/Alpha/add.ll
blob: ce2343458dfce2643cb894d5849bcd43a4655900 (plain)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
;test all the shifted and signextending adds and subs with and without consts

; RUN: llvm-as < %s | llc -march=alpha | grep '	addl' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep '	addq' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep '	subl' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep '	subq' |wc -l |grep 1
; RUN: llvm-as < %s | llc -march=alpha | grep 'lda $0,-100($16)' |wc -l |grep 1

; RUN: llvm-as < %s | llc -march=alpha | grep 's4addl' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep 's8addl' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep 's4addq' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep 's8addq' |wc -l |grep 2

; RUN: llvm-as < %s | llc -march=alpha | grep 's4subl' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep 's8subl' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep 's4subq' |wc -l |grep 2
; RUN: llvm-as < %s | llc -march=alpha | grep 's8subq' |wc -l |grep 2

implementation   ; Functions:

int %al(int %x, int %y) {
entry:
        %tmp.3 = add int %y, %x
        ret int %tmp.3
}

int %ali(int %x) {
entry:
        %tmp.3 = add int 100, %x
        ret int %tmp.3
}

long %aq(long %x, long %y) {
entry:
        %tmp.3 = add long %y, %x
        ret long %tmp.3
}
long %aqi(long %x) {
entry:
        %tmp.3 = add long 100, %x
        ret long %tmp.3
}

int %sl(int %x, int %y) {
entry:
        %tmp.3 = sub int %y, %x
        ret int %tmp.3
}

int %sli(int %x) {
entry:
        %tmp.3 = sub int %x, 100
        ret int %tmp.3
}

long %sq(long %x, long %y) {
entry:
        %tmp.3 = sub long %y, %x
        ret long %tmp.3
}
long %sqi(long %x) {
entry:
        %tmp.3 = sub long %x, 100
        ret long %tmp.3
}



int %a4l(int %x, int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 2
        %tmp.3 = add int %tmp.1, %x
        ret int %tmp.3
}

int %a8l(int %x, int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 3
        %tmp.3 = add int %tmp.1, %x
        ret int %tmp.3
}

long %a4q(long %x, long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 2
        %tmp.3 = add long %tmp.1, %x
        ret long %tmp.3
}

long %a8q(long %x, long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 3
        %tmp.3 = add long %tmp.1, %x
        ret long %tmp.3
}

int %a4li(int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 2
        %tmp.3 = add int 100, %tmp.1
        ret int %tmp.3
}

int %a8li(int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 3
        %tmp.3 = add int 100, %tmp.1
        ret int %tmp.3
}

long %a4qi(long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 2
        %tmp.3 = add long 100, %tmp.1
        ret long %tmp.3
}

long %a8qi(long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 3
        %tmp.3 = add long 100, %tmp.1
        ret long %tmp.3
}




int %s4l(int %x, int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 2
        %tmp.3 = sub int %tmp.1, %x
        ret int %tmp.3
}

int %s8l(int %x, int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 3
        %tmp.3 = sub int %tmp.1, %x
        ret int %tmp.3
}

long %s4q(long %x, long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 2
        %tmp.3 = sub long %tmp.1, %x
        ret long %tmp.3
}

long %s8q(long %x, long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 3
        %tmp.3 = sub long %tmp.1, %x
        ret long %tmp.3
}

int %s4li(int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 2
        %tmp.3 = sub int %tmp.1, 100
        ret int %tmp.3
}

int %s8li(int %y) {
entry:
        %tmp.1 = shl int %y, ubyte 3
        %tmp.3 = sub int %tmp.1, 100
        ret int %tmp.3
}

long %s4qi(long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 2
        %tmp.3 = sub long %tmp.1, 100
        ret long %tmp.3
}

long %s8qi(long %y) {
entry:
        %tmp.1 = shl long %y, ubyte 3
        %tmp.3 = sub long %tmp.1, 100
        ret long %tmp.3
}