mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-19 11:23:32 +00:00
[mips][mips64r6] Add R_MIPS_PC19_S2
Differential Revision: http://reviews.llvm.org/D3866 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -621,11 +621,21 @@ unsigned
|
||||
MipsMCCodeEmitter::getSimm19Lsl2Encoding(const MCInst &MI, unsigned OpNo,
|
||||
SmallVectorImpl<MCFixup> &Fixups,
|
||||
const MCSubtargetInfo &STI) const {
|
||||
assert(MI.getOperand(OpNo).isImm());
|
||||
// The immediate is encoded as 'immediate << 2'.
|
||||
unsigned Res = getMachineOpValue(MI, MI.getOperand(OpNo), Fixups, STI);
|
||||
assert((Res & 3) == 0);
|
||||
return Res >> 2;
|
||||
const MCOperand &MO = MI.getOperand(OpNo);
|
||||
if (MO.isImm()) {
|
||||
// The immediate is encoded as 'immediate << 2'.
|
||||
unsigned Res = getMachineOpValue(MI, MO, Fixups, STI);
|
||||
assert((Res & 3) == 0);
|
||||
return Res >> 2;
|
||||
}
|
||||
|
||||
assert(MO.isExpr() &&
|
||||
"getSimm19Lsl2Encoding expects only expressions or an immediate");
|
||||
|
||||
const MCExpr *Expr = MO.getExpr();
|
||||
Fixups.push_back(MCFixup::Create(0, Expr,
|
||||
MCFixupKind(Mips::fixup_MIPS_PC19_S2)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned
|
||||
|
||||
Reference in New Issue
Block a user