mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 08:46:37 +00:00
Add Thumb-2 patterns for ARMsrl_flag and ARMsra_flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77329 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a3c924f83a
commit
3583df7676
@ -715,9 +715,18 @@ defm t2ASR : T2I_sh_ir<"asr", BinOpFrag<(sra node:$LHS, node:$RHS)>>;
|
||||
defm t2ROR : T2I_sh_ir<"ror", BinOpFrag<(rotr node:$LHS, node:$RHS)>>;
|
||||
|
||||
def t2MOVrx : T2sI<(outs GPR:$dst), (ins GPR:$src),
|
||||
"mov", " $dst, $src, rrx",
|
||||
"rrx", " $dst, $src",
|
||||
[(set GPR:$dst, (ARMrrx GPR:$src))]>;
|
||||
|
||||
let Defs = [CPSR] in {
|
||||
def t2MOVsrl_flag : T2XI<(outs GPR:$dst), (ins GPR:$src),
|
||||
"lsrs.w $dst, $src, #1",
|
||||
[(set GPR:$dst, (ARMsrl_flag GPR:$src))]>;
|
||||
def t2MOVsra_flag : T2XI<(outs GPR:$dst), (ins GPR:$src),
|
||||
"asrs.w $dst, $src, #1",
|
||||
[(set GPR:$dst, (ARMsra_flag GPR:$src))]>;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Bitwise Instructions.
|
||||
//
|
||||
|
19
test/CodeGen/Thumb2/thumb2-lsr3.ll
Normal file
19
test/CodeGen/Thumb2/thumb2-lsr3.ll
Normal file
@ -0,0 +1,19 @@
|
||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2
|
||||
|
||||
define i1 @test1(i64 %poscnt, i32 %work) {
|
||||
entry:
|
||||
; CHECK: rrx r0, r0
|
||||
; CHECK: lsrs.w r1, r1, #1
|
||||
%0 = lshr i64 %poscnt, 1
|
||||
%1 = icmp eq i64 %0, 0
|
||||
ret i1 %1
|
||||
}
|
||||
|
||||
define i1 @test2(i64 %poscnt, i32 %work) {
|
||||
entry:
|
||||
; CHECK: rrx r0, r0
|
||||
; CHECK: asrs.w r1, r1, #1
|
||||
%0 = ashr i64 %poscnt, 1
|
||||
%1 = icmp eq i64 %0, 0
|
||||
ret i1 %1
|
||||
}
|
Loading…
Reference in New Issue
Block a user