mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
When possible, use "mvn ra, rb" instead of "eor ra, rb, -1" because mvn has a narrow version and eor(i) does not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
16bdfdb178
commit
dcdaebc592
@ -482,6 +482,8 @@ defm t2ORN : T2I_bin_irs<"orn", BinOpFrag<(or node:$LHS, (not node:$RHS))>>;
|
||||
def : Thumb2Pat<(or GPR:$src, t2_so_imm_not:$imm),
|
||||
(t2ORNri GPR:$src, t2_so_imm_not:$imm)>;
|
||||
|
||||
// Prefer over of t2EORri ra, rb, -1 because mvn has 16-bit version
|
||||
let AddedComplexity = 1 in
|
||||
defm t2MVN : T2I_un_irs <"mvn", UnOpFrag<(not node:$Src)>, 1, 1>;
|
||||
|
||||
def : Thumb2Pat<(t2_so_imm_not:$src),
|
||||
|
11
test/CodeGen/Thumb2/thumb2-mvn2.ll
Normal file
11
test/CodeGen/Thumb2/thumb2-mvn2.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 2
|
||||
|
||||
define i32 @f1(i32 %a) {
|
||||
%tmp = xor i32 4294967295, %a
|
||||
ret i32 %tmp
|
||||
}
|
||||
|
||||
define i32 @f2(i32 %a) {
|
||||
%tmp = xor i32 %a, 4294967295
|
||||
ret i32 %tmp
|
||||
}
|
Loading…
Reference in New Issue
Block a user