blob: 89d3223747e43eff702cbebfc1d047220eb12f44 [file] [log] [blame]
David Goodwin2f6f1132009-07-27 16:31:55 +00001; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]$} | count 2
2; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsl\\W*#5$} | count 1
3; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*lsr\\W*#6$} | count 1
4; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*asr\\W*#7$} | count 1
5; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1
David Goodwin71ee46b2009-06-26 22:37:07 +00006
7define i32 @f1(i32 %a, i32 %b) {
8 %tmp = xor i32 %a, %b
9 ret i32 %tmp
10}
David Goodwin412a6f22009-06-30 01:02:20 +000011
12define i32 @f2(i32 %a, i32 %b) {
13 %tmp = xor i32 %b, %a
14 ret i32 %tmp
15}
16
17define i32 @f3(i32 %a, i32 %b) {
18 %tmp = shl i32 %b, 5
19 %tmp1 = xor i32 %a, %tmp
20 ret i32 %tmp1
21}
22
23define i32 @f4(i32 %a, i32 %b) {
24 %tmp = lshr i32 %b, 6
25 %tmp1 = xor i32 %tmp, %a
26 ret i32 %tmp1
27}
28
29define i32 @f5(i32 %a, i32 %b) {
30 %tmp = ashr i32 %b, 7
31 %tmp1 = xor i32 %a, %tmp
32 ret i32 %tmp1
33}
34
35define i32 @f6(i32 %a, i32 %b) {
36 %l8 = shl i32 %a, 24
37 %r8 = lshr i32 %a, 8
38 %tmp = or i32 %l8, %r8
39 %tmp1 = xor i32 %tmp, %a
40 ret i32 %tmp1
41}