mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
ARM/Thumb2 'cmp rn, #imm' alias to cmn.
When 'cmp rn #imm' doesn't match due to the immediate not being representable, but 'cmn rn, #-imm' does match, use the latter in place of the former, as it's equivalent. rdar://10552389 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146567 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5089,6 +5089,11 @@ def : ARMInstAlias<"add${s}${p} $Rd, $Rn, $imm",
|
||||
(SUBri GPR:$Rd, GPR:$Rn, so_imm_neg:$imm, pred:$p, cc_out:$s)>;
|
||||
def : ARMInstAlias<"add${s}${p} $Rd, $imm",
|
||||
(SUBri GPR:$Rd, GPR:$Rd, so_imm_neg:$imm, pred:$p, cc_out:$s)>;
|
||||
// Same for CMP <--> CMN via t2_so_imm_neg
|
||||
def : ARMInstAlias<"cmp${p} $Rd, $imm",
|
||||
(CMNzri rGPR:$Rd, t2_so_imm_neg:$imm, pred:$p)>;
|
||||
def : ARMInstAlias<"cmn${p} $Rd, $imm",
|
||||
(CMPri rGPR:$Rd, t2_so_imm_neg:$imm, pred:$p)>;
|
||||
|
||||
// The shifter forms of the MOV instruction are aliased to the ASR, LSL,
|
||||
// LSR, ROR, and RRX instructions.
|
||||
|
@@ -4110,13 +4110,18 @@ def : t2InstAlias<"and${s}${p} $Rd, $Rn, $imm",
|
||||
def : t2InstAlias<"and${s}${p} $Rdn, $imm",
|
||||
(t2BICri rGPR:$Rdn, rGPR:$Rdn, so_imm_not:$imm,
|
||||
pred:$p, cc_out:$s)>;
|
||||
// Likewise, "add Rd, so_imm_neg" -> sub
|
||||
// Likewise, "add Rd, t2_so_imm_neg" -> sub
|
||||
def : t2InstAlias<"add${s}${p} $Rd, $Rn, $imm",
|
||||
(t2SUBri GPRnopc:$Rd, GPRnopc:$Rn, t2_so_imm_neg:$imm,
|
||||
pred:$p, cc_out:$s)>;
|
||||
def : t2InstAlias<"add${s}${p} $Rd, $imm",
|
||||
(t2SUBri GPRnopc:$Rd, GPRnopc:$Rd, t2_so_imm_neg:$imm,
|
||||
pred:$p, cc_out:$s)>;
|
||||
// Same for CMP <--> CMN via t2_so_imm_neg
|
||||
def : t2InstAlias<"cmp${p} $Rd, $imm",
|
||||
(t2CMNzri rGPR:$Rd, t2_so_imm_neg:$imm, pred:$p)>;
|
||||
def : t2InstAlias<"cmn${p} $Rd, $imm",
|
||||
(t2CMPri rGPR:$Rd, t2_so_imm_neg:$imm, pred:$p)>;
|
||||
|
||||
|
||||
// Wide 'mul' encoding can be specified with only two operands.
|
||||
|
Reference in New Issue
Block a user