David Goodwin | 2f6f113 | 2009-07-27 16:31:55 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\]$} | count 4 |
| 2 | ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\.w\\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 {cmn\\.w\\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 {cmn\\.w\\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 {cmn\\.w\\W*r\[0-9\],\\W*r\[0-9\],\\W*ror\\W*#8$} | count 1 |
David Goodwin | 8bdcbb3 | 2009-06-29 15:33:01 +0000 | [diff] [blame] | 6 | |
| 7 | define i1 @f1(i32 %a, i32 %b) { |
| 8 | %nb = sub i32 0, %b |
| 9 | %tmp = icmp ne i32 %a, %nb |
| 10 | ret i1 %tmp |
| 11 | } |
| 12 | |
| 13 | define i1 @f2(i32 %a, i32 %b) { |
| 14 | %nb = sub i32 0, %b |
| 15 | %tmp = icmp ne i32 %nb, %a |
| 16 | ret i1 %tmp |
| 17 | } |
| 18 | |
| 19 | define i1 @f3(i32 %a, i32 %b) { |
| 20 | %nb = sub i32 0, %b |
| 21 | %tmp = icmp eq i32 %a, %nb |
| 22 | ret i1 %tmp |
| 23 | } |
| 24 | |
| 25 | define i1 @f4(i32 %a, i32 %b) { |
| 26 | %nb = sub i32 0, %b |
| 27 | %tmp = icmp eq i32 %nb, %a |
| 28 | ret i1 %tmp |
| 29 | } |
David Goodwin | 412a6f2 | 2009-06-30 01:02:20 +0000 | [diff] [blame] | 30 | |
| 31 | define i1 @f5(i32 %a, i32 %b) { |
| 32 | %tmp = shl i32 %b, 5 |
| 33 | %nb = sub i32 0, %tmp |
| 34 | %tmp1 = icmp eq i32 %nb, %a |
| 35 | ret i1 %tmp1 |
| 36 | } |
| 37 | |
| 38 | define i1 @f6(i32 %a, i32 %b) { |
| 39 | %tmp = lshr i32 %b, 6 |
| 40 | %nb = sub i32 0, %tmp |
| 41 | %tmp1 = icmp ne i32 %nb, %a |
| 42 | ret i1 %tmp1 |
| 43 | } |
| 44 | |
| 45 | define i1 @f7(i32 %a, i32 %b) { |
| 46 | %tmp = ashr i32 %b, 7 |
| 47 | %nb = sub i32 0, %tmp |
| 48 | %tmp1 = icmp eq i32 %a, %nb |
| 49 | ret i1 %tmp1 |
| 50 | } |
| 51 | |
| 52 | define i1 @f8(i32 %a, i32 %b) { |
| 53 | %l8 = shl i32 %a, 24 |
| 54 | %r8 = lshr i32 %a, 8 |
| 55 | %tmp = or i32 %l8, %r8 |
| 56 | %nb = sub i32 0, %tmp |
| 57 | %tmp1 = icmp ne i32 %a, %nb |
| 58 | ret i1 %tmp1 |
| 59 | } |