blob: 5e25cf64bccbd722032682143d1678f8e44dc0d2 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep #255
2; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep #256
3; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep #257
4; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep #4094
5; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep #4095
6; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep #4096
7; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add
8; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep add | grep lsl | grep #8
Anton Korobeynikov52237112009-06-17 18:13:58 +00009
10define i32 @t2ADDrc_255(i32 %lhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000011 %Rd = add i32 %lhs, 255
Anton Korobeynikov52237112009-06-17 18:13:58 +000012 ret i32 %Rd
13}
14
15define i32 @t2ADDrc_256(i32 %lhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000016 %Rd = add i32 %lhs, 256
Anton Korobeynikov52237112009-06-17 18:13:58 +000017 ret i32 %Rd
18}
19
20define i32 @t2ADDrc_257(i32 %lhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000021 %Rd = add i32 %lhs, 257
Anton Korobeynikov52237112009-06-17 18:13:58 +000022 ret i32 %Rd
23}
24
25define i32 @t2ADDrc_4094(i32 %lhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000026 %Rd = add i32 %lhs, 4094
Anton Korobeynikov52237112009-06-17 18:13:58 +000027 ret i32 %Rd
28}
29
30define i32 @t2ADDrc_4095(i32 %lhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000031 %Rd = add i32 %lhs, 4095
Anton Korobeynikov52237112009-06-17 18:13:58 +000032 ret i32 %Rd
33}
34
35define i32 @t2ADDrc_4096(i32 %lhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000036 %Rd = add i32 %lhs, 4096
Anton Korobeynikov52237112009-06-17 18:13:58 +000037 ret i32 %Rd
38}
39
40define i32 @t2ADDrr(i32 %lhs, i32 %rhs) {
Dan Gohmanaceba312010-01-05 17:55:26 +000041 %Rd = add i32 %lhs, %rhs
Anton Korobeynikov52237112009-06-17 18:13:58 +000042 ret i32 %Rd
43}
44
45define i32 @t2ADDrs(i32 %lhs, i32 %rhs) {
46 %tmp = shl i32 %rhs, 8
Dan Gohmanaceba312010-01-05 17:55:26 +000047 %Rd = add i32 %lhs, %tmp
Anton Korobeynikov52237112009-06-17 18:13:58 +000048 ret i32 %Rd
49}
50