blob: 057b5f067f803baba3635ab9703c18a8c41dedd6 [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm > %t
Dan Gohman8c89a502007-08-15 13:36:28 +00002; RUN: grep rrx %t | count 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +00003; RUN: grep __ashldi3 %t
4; RUN: grep __ashrdi3 %t
5; RUN: grep __lshrdi3 %t
6
7define 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
14define 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
20define 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
26define i32 @f3(i64 %x, i64 %y) {
27 %a = lshr i64 %x, %y
28 %b = trunc i64 %a to i32
29 ret i32 %b
30}