blob: 55d0cdc54151ccb034e2d2ee2950d823b3d73400 [file] [log] [blame]
Reid Spencereb1d74e2007-04-16 17:36:08 +00001; RUN: llvm-as < %s | llc -march=arm > %t
Dan Gohman28beeea2007-08-15 13:36:28 +00002; RUN: grep rrx %t | count 1
Reid Spencereb1d74e2007-04-16 17:36:08 +00003; RUN: grep __ashldi3 %t
4; RUN: grep __ashrdi3 %t
5; RUN: grep __lshrdi3 %t
Evan Cheng02b985c2007-01-19 09:20:23 +00006
Reid Spencer832254e2007-02-02 02:16:23 +00007define i64 @f0(i64 %A, i64 %B) {
Evan Cheng1091a972007-01-27 00:04:57 +00008 %tmp = bitcast i64 %A to i64
Reid Spencer832254e2007-02-02 02:16:23 +00009 %tmp2 = lshr i64 %B, 1
Evan Cheng1091a972007-01-27 00:04:57 +000010 %tmp3 = sub i64 %tmp, %tmp2
11 ret i64 %tmp3
Evan Cheng02b985c2007-01-19 09:20:23 +000012}
13
Reid Spencer832254e2007-02-02 02:16:23 +000014define i32 @f1(i64 %x, i64 %y) {
15 %a = shl i64 %x, %y
Evan Cheng1091a972007-01-27 00:04:57 +000016 %b = trunc i64 %a to i32
17 ret i32 %b
18}
19
Reid Spencer832254e2007-02-02 02:16:23 +000020define i32 @f2(i64 %x, i64 %y) {
21 %a = ashr i64 %x, %y
Evan Cheng1091a972007-01-27 00:04:57 +000022 %b = trunc i64 %a to i32
23 ret i32 %b
24}
25
Reid Spencer832254e2007-02-02 02:16:23 +000026define i32 @f3(i64 %x, i64 %y) {
27 %a = lshr i64 %x, %y
Evan Cheng1091a972007-01-27 00:04:57 +000028 %b = trunc i64 %a to i32
29 ret i32 %b
30}