mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
ARM assembler aliases for "add Rd, #-imm" to "sub Rd, #imm".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -749,6 +749,14 @@ public:
|
||||
int64_t Value = CE->getValue();
|
||||
return ARM_AM::getSOImmVal(~Value) != -1;
|
||||
}
|
||||
bool isARMSOImmNeg() const {
|
||||
if (Kind != k_Immediate)
|
||||
return false;
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
|
||||
if (!CE) return false;
|
||||
int64_t Value = CE->getValue();
|
||||
return ARM_AM::getSOImmVal(-Value) != -1;
|
||||
}
|
||||
bool isT2SOImm() const {
|
||||
if (Kind != k_Immediate)
|
||||
return false;
|
||||
@@ -765,6 +773,14 @@ public:
|
||||
int64_t Value = CE->getValue();
|
||||
return ARM_AM::getT2SOImmVal(~Value) != -1;
|
||||
}
|
||||
bool isT2SOImmNeg() const {
|
||||
if (Kind != k_Immediate)
|
||||
return false;
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
|
||||
if (!CE) return false;
|
||||
int64_t Value = CE->getValue();
|
||||
return ARM_AM::getT2SOImmVal(-Value) != -1;
|
||||
}
|
||||
bool isSetEndImm() const {
|
||||
if (Kind != k_Immediate)
|
||||
return false;
|
||||
@@ -1321,6 +1337,14 @@ public:
|
||||
Inst.addOperand(MCOperand::CreateImm(~CE->getValue()));
|
||||
}
|
||||
|
||||
void addT2SOImmNegOperands(MCInst &Inst, unsigned N) const {
|
||||
assert(N == 1 && "Invalid number of operands!");
|
||||
// The operand is actually a t2_so_imm, but we have its
|
||||
// negation in the assembly source, so twiddle it here.
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
|
||||
Inst.addOperand(MCOperand::CreateImm(-CE->getValue()));
|
||||
}
|
||||
|
||||
void addARMSOImmNotOperands(MCInst &Inst, unsigned N) const {
|
||||
assert(N == 1 && "Invalid number of operands!");
|
||||
// The operand is actually a so_imm, but we have its bitwise
|
||||
@@ -1329,6 +1353,14 @@ public:
|
||||
Inst.addOperand(MCOperand::CreateImm(~CE->getValue()));
|
||||
}
|
||||
|
||||
void addARMSOImmNegOperands(MCInst &Inst, unsigned N) const {
|
||||
assert(N == 1 && "Invalid number of operands!");
|
||||
// The operand is actually a so_imm, but we have its
|
||||
// negation in the assembly source, so twiddle it here.
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
|
||||
Inst.addOperand(MCOperand::CreateImm(-CE->getValue()));
|
||||
}
|
||||
|
||||
void addMemBarrierOptOperands(MCInst &Inst, unsigned N) const {
|
||||
assert(N == 1 && "Invalid number of operands!");
|
||||
Inst.addOperand(MCOperand::CreateImm(unsigned(getMemBarrierOpt())));
|
||||
|
Reference in New Issue
Block a user