blob: 516270e0df6a2c37a6d0414e9b3dc033f9923449 [file] [log] [blame]
Andrew Lenhartha54f6b12006-10-31 19:50:55 +00001;test all the shifted and signextending adds and subs with and without consts
2
Reid Spencer69ccadd2006-12-02 04:23:10 +00003; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ' addl' |wc -l |grep 2 &&
4; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ' addq' |wc -l |grep 2 &&
5; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ' subl' |wc -l |grep 2 &&
6; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep ' subq' |wc -l |grep 1 &&
7; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 'lda $0,-100($16)' |wc -l |grep 1 &&
Andrew Lenhartha54f6b12006-10-31 19:50:55 +00008
Reid Spencer69ccadd2006-12-02 04:23:10 +00009; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's4addl' |wc -l |grep 2 &&
10; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's8addl' |wc -l |grep 2 &&
11; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's4addq' |wc -l |grep 2 &&
12; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's8addq' |wc -l |grep 2 &&
Andrew Lenhartha54f6b12006-10-31 19:50:55 +000013
Reid Spencer69ccadd2006-12-02 04:23:10 +000014; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's4subl' |wc -l |grep 2 &&
15; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's8subl' |wc -l |grep 2 &&
16; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's4subq' |wc -l |grep 2 &&
17; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep 's8subq' |wc -l |grep 2
Andrew Lenhartha54f6b12006-10-31 19:50:55 +000018
19implementation ; Functions:
20
21int %al(int %x, int %y) {
22entry:
23 %tmp.3 = add int %y, %x
24 ret int %tmp.3
25}
26
27int %ali(int %x) {
28entry:
29 %tmp.3 = add int 100, %x
30 ret int %tmp.3
31}
32
33long %aq(long %x, long %y) {
34entry:
35 %tmp.3 = add long %y, %x
36 ret long %tmp.3
37}
38long %aqi(long %x) {
39entry:
40 %tmp.3 = add long 100, %x
41 ret long %tmp.3
42}
43
44int %sl(int %x, int %y) {
45entry:
46 %tmp.3 = sub int %y, %x
47 ret int %tmp.3
48}
49
50int %sli(int %x) {
51entry:
52 %tmp.3 = sub int %x, 100
53 ret int %tmp.3
54}
55
56long %sq(long %x, long %y) {
57entry:
58 %tmp.3 = sub long %y, %x
59 ret long %tmp.3
60}
61long %sqi(long %x) {
62entry:
63 %tmp.3 = sub long %x, 100
64 ret long %tmp.3
65}
66
67
68
69int %a4l(int %x, int %y) {
70entry:
71 %tmp.1 = shl int %y, ubyte 2
72 %tmp.3 = add int %tmp.1, %x
73 ret int %tmp.3
74}
75
76int %a8l(int %x, int %y) {
77entry:
78 %tmp.1 = shl int %y, ubyte 3
79 %tmp.3 = add int %tmp.1, %x
80 ret int %tmp.3
81}
82
83long %a4q(long %x, long %y) {
84entry:
85 %tmp.1 = shl long %y, ubyte 2
86 %tmp.3 = add long %tmp.1, %x
87 ret long %tmp.3
88}
89
90long %a8q(long %x, long %y) {
91entry:
92 %tmp.1 = shl long %y, ubyte 3
93 %tmp.3 = add long %tmp.1, %x
94 ret long %tmp.3
95}
96
97int %a4li(int %y) {
98entry:
99 %tmp.1 = shl int %y, ubyte 2
100 %tmp.3 = add int 100, %tmp.1
101 ret int %tmp.3
102}
103
104int %a8li(int %y) {
105entry:
106 %tmp.1 = shl int %y, ubyte 3
107 %tmp.3 = add int 100, %tmp.1
108 ret int %tmp.3
109}
110
111long %a4qi(long %y) {
112entry:
113 %tmp.1 = shl long %y, ubyte 2
114 %tmp.3 = add long 100, %tmp.1
115 ret long %tmp.3
116}
117
118long %a8qi(long %y) {
119entry:
120 %tmp.1 = shl long %y, ubyte 3
121 %tmp.3 = add long 100, %tmp.1
122 ret long %tmp.3
123}
124
125
126
127
128int %s4l(int %x, int %y) {
129entry:
130 %tmp.1 = shl int %y, ubyte 2
131 %tmp.3 = sub int %tmp.1, %x
132 ret int %tmp.3
133}
134
135int %s8l(int %x, int %y) {
136entry:
137 %tmp.1 = shl int %y, ubyte 3
138 %tmp.3 = sub int %tmp.1, %x
139 ret int %tmp.3
140}
141
142long %s4q(long %x, long %y) {
143entry:
144 %tmp.1 = shl long %y, ubyte 2
145 %tmp.3 = sub long %tmp.1, %x
146 ret long %tmp.3
147}
148
149long %s8q(long %x, long %y) {
150entry:
151 %tmp.1 = shl long %y, ubyte 3
152 %tmp.3 = sub long %tmp.1, %x
153 ret long %tmp.3
154}
155
156int %s4li(int %y) {
157entry:
158 %tmp.1 = shl int %y, ubyte 2
159 %tmp.3 = sub int %tmp.1, 100
160 ret int %tmp.3
161}
162
163int %s8li(int %y) {
164entry:
165 %tmp.1 = shl int %y, ubyte 3
166 %tmp.3 = sub int %tmp.1, 100
167 ret int %tmp.3
168}
169
170long %s4qi(long %y) {
171entry:
172 %tmp.1 = shl long %y, ubyte 2
173 %tmp.3 = sub long %tmp.1, 100
174 ret long %tmp.3
175}
176
177long %s8qi(long %y) {
178entry:
179 %tmp.1 = shl long %y, ubyte 3
180 %tmp.3 = sub long %tmp.1, 100
181 ret long %tmp.3
182}
183