1 ;test all the shifted and signextending adds and subs with and without consts
3 ; RUN: llc < %s -march=alpha -o %t.s
4 ; RUN: grep { addl} %t.s | count 2
5 ; RUN: grep { addq} %t.s | count 2
6 ; RUN: grep { subl} %t.s | count 2
7 ; RUN: grep { subq} %t.s | count 1
9 ; RUN: grep {lda \$0,-100(\$16)} %t.s | count 1
10 ; RUN: grep {s4addl} %t.s | count 2
11 ; RUN: grep {s8addl} %t.s | count 2
12 ; RUN: grep {s4addq} %t.s | count 2
13 ; RUN: grep {s8addq} %t.s | count 2
15 ; RUN: grep {s4subl} %t.s | count 2
16 ; RUN: grep {s8subl} %t.s | count 2
17 ; RUN: grep {s4subq} %t.s | count 2
18 ; RUN: grep {s8subq} %t.s | count 2
21 define i32 @al(i32 signext %x.s, i32 signext %y.s) signext {
23 %tmp.3.s = add i32 %y.s, %x.s ; <i32> [#uses=1]
27 define i32 @ali(i32 signext %x.s) signext {
29 %tmp.3.s = add i32 100, %x.s ; <i32> [#uses=1]
33 define i64 @aq(i64 signext %x.s, i64 signext %y.s) signext {
35 %tmp.3.s = add i64 %y.s, %x.s ; <i64> [#uses=1]
39 define i64 @aqi(i64 %x.s) {
41 %tmp.3.s = add i64 100, %x.s ; <i64> [#uses=1]
45 define i32 @sl(i32 signext %x.s, i32 signext %y.s) signext {
47 %tmp.3.s = sub i32 %y.s, %x.s ; <i32> [#uses=1]
51 define i32 @sli(i32 signext %x.s) signext {
53 %tmp.3.s = sub i32 %x.s, 100 ; <i32> [#uses=1]
57 define i64 @sq(i64 %x.s, i64 %y.s) {
59 %tmp.3.s = sub i64 %y.s, %x.s ; <i64> [#uses=1]
63 define i64 @sqi(i64 %x.s) {
65 %tmp.3.s = sub i64 %x.s, 100 ; <i64> [#uses=1]
69 define i32 @a4l(i32 signext %x.s, i32 signext %y.s) signext {
71 %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
72 %tmp.3.s = add i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
76 define i32 @a8l(i32 signext %x.s, i32 signext %y.s) signext {
78 %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
79 %tmp.3.s = add i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
83 define i64 @a4q(i64 %x.s, i64 %y.s) {
85 %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
86 %tmp.3.s = add i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
90 define i64 @a8q(i64 %x.s, i64 %y.s) {
92 %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
93 %tmp.3.s = add i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
97 define i32 @a4li(i32 signext %y.s) signext {
99 %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
100 %tmp.3.s = add i32 100, %tmp.1.s ; <i32> [#uses=1]
104 define i32 @a8li(i32 signext %y.s) signext {
106 %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
107 %tmp.3.s = add i32 100, %tmp.1.s ; <i32> [#uses=1]
111 define i64 @a4qi(i64 %y.s) {
113 %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
114 %tmp.3.s = add i64 100, %tmp.1.s ; <i64> [#uses=1]
118 define i64 @a8qi(i64 %y.s) {
120 %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
121 %tmp.3.s = add i64 100, %tmp.1.s ; <i64> [#uses=1]
125 define i32 @s4l(i32 signext %x.s, i32 signext %y.s) signext {
127 %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
128 %tmp.3.s = sub i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
132 define i32 @s8l(i32 signext %x.s, i32 signext %y.s) signext {
134 %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
135 %tmp.3.s = sub i32 %tmp.1.s, %x.s ; <i32> [#uses=1]
139 define i64 @s4q(i64 %x.s, i64 %y.s) {
141 %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
142 %tmp.3.s = sub i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
146 define i64 @s8q(i64 %x.s, i64 %y.s) {
148 %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
149 %tmp.3.s = sub i64 %tmp.1.s, %x.s ; <i64> [#uses=1]
153 define i32 @s4li(i32 signext %y.s) signext {
155 %tmp.1.s = shl i32 %y.s, 2 ; <i32> [#uses=1]
156 %tmp.3.s = sub i32 %tmp.1.s, 100 ; <i32> [#uses=1]
160 define i32 @s8li(i32 signext %y.s) signext {
162 %tmp.1.s = shl i32 %y.s, 3 ; <i32> [#uses=1]
163 %tmp.3.s = sub i32 %tmp.1.s, 100 ; <i32> [#uses=1]
167 define i64 @s4qi(i64 %y.s) {
169 %tmp.1.s = shl i64 %y.s, 2 ; <i64> [#uses=1]
170 %tmp.3.s = sub i64 %tmp.1.s, 100 ; <i64> [#uses=1]
174 define i64 @s8qi(i64 %y.s) {
176 %tmp.1.s = shl i64 %y.s, 3 ; <i64> [#uses=1]
177 %tmp.3.s = sub i64 %tmp.1.s, 100 ; <i64> [#uses=1]