Dan Gohman | da594cf | 2009-09-09 00:09:15 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=arm > %t |
Dan Gohman | 8c89a50 | 2007-08-15 13:36:28 +0000 | [diff] [blame] | 2 | ; RUN: grep rrx %t | count 1 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 3 | ; RUN: grep __ashldi3 %t |
| 4 | ; RUN: grep __ashrdi3 %t |
| 5 | ; RUN: grep __lshrdi3 %t |
| 6 | |
| 7 | define i64 @f0(i64 %A, i64 %B) { |
| 8 | %tmp = bitcast i64 %A to i64 |
| 9 | %tmp2 = lshr i64 %B, 1 |
| 10 | %tmp3 = sub i64 %tmp, %tmp2 |
| 11 | ret i64 %tmp3 |
| 12 | } |
| 13 | |
| 14 | define i32 @f1(i64 %x, i64 %y) { |
| 15 | %a = shl i64 %x, %y |
| 16 | %b = trunc i64 %a to i32 |
| 17 | ret i32 %b |
| 18 | } |
| 19 | |
| 20 | define i32 @f2(i64 %x, i64 %y) { |
| 21 | %a = ashr i64 %x, %y |
| 22 | %b = trunc i64 %a to i32 |
| 23 | ret i32 %b |
| 24 | } |
| 25 | |
| 26 | define i32 @f3(i64 %x, i64 %y) { |
| 27 | %a = lshr i64 %x, %y |
| 28 | %b = trunc i64 %a to i32 |
| 29 | ret i32 %b |
| 30 | } |