~ubuntu-branches/ubuntu/quantal/llvm-3.1/quantal

« back to all changes in this revision

Viewing changes to test/CodeGen/Thumb2/thumb2-ror.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-03-29 19:09:51 UTC
  • Revision ID: package-import@ubuntu.com-20120329190951-aq83ivog4cg8bxun
Tags: upstream-3.1~svn153643
ImportĀ upstreamĀ versionĀ 3.1~svn153643

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
 
2
 
 
3
 
 
4
; CHECK: f1:
 
5
; CHECK:        ror.w   r0, r0, #22
 
6
define i32 @f1(i32 %a) {
 
7
    %l8 = shl i32 %a, 10
 
8
    %r8 = lshr i32 %a, 22
 
9
    %tmp = or i32 %l8, %r8
 
10
    ret i32 %tmp
 
11
}
 
12
 
 
13
; CHECK: f2:
 
14
; CHECK-NOT: and
 
15
; CHECK: ror
 
16
define i32 @f2(i32 %v, i32 %nbits) {
 
17
entry:
 
18
  %and = and i32 %nbits, 31
 
19
  %shr = lshr i32 %v, %and
 
20
  %sub = sub i32 32, %and
 
21
  %shl = shl i32 %v, %sub
 
22
  %or = or i32 %shl, %shr
 
23
  ret i32 %or
 
24
}
 
 
b'\\ No newline at end of file'