mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
[mips][microMIPS] Implement BEQZ16 and BNEZ16 instructions
Differential Revision: http://reviews.llvm.org/D5271 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -103,6 +103,14 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
|
||||
case Mips::fixup_MICROMIPS_26_S1:
|
||||
Value >>= 1;
|
||||
break;
|
||||
case Mips::fixup_MICROMIPS_PC7_S1:
|
||||
Value -= 4;
|
||||
// Forcing a signed division because Value can be negative.
|
||||
Value = (int64_t) Value / 2;
|
||||
// We now check if Value can be encoded as a 7-bit signed immediate.
|
||||
if (!isIntN(7, Value) && Ctx)
|
||||
Ctx->FatalError(Fixup.getLoc(), "out of range PC7 fixup");
|
||||
break;
|
||||
case Mips::fixup_MICROMIPS_PC16_S1:
|
||||
Value -= 4;
|
||||
// Forcing a signed division because Value can be negative.
|
||||
@@ -271,6 +279,7 @@ getFixupKindInfo(MCFixupKind Kind) const {
|
||||
{ "fixup_MICROMIPS_HI16", 0, 16, 0 },
|
||||
{ "fixup_MICROMIPS_LO16", 0, 16, 0 },
|
||||
{ "fixup_MICROMIPS_GOT16", 0, 16, 0 },
|
||||
{ "fixup_MICROMIPS_PC7_S1", 0, 7, MCFixupKindInfo::FKF_IsPCRel },
|
||||
{ "fixup_MICROMIPS_PC16_S1", 0, 16, MCFixupKindInfo::FKF_IsPCRel },
|
||||
{ "fixup_MICROMIPS_CALL16", 0, 16, 0 },
|
||||
{ "fixup_MICROMIPS_GOT_DISP", 0, 16, 0 },
|
||||
@@ -334,6 +343,7 @@ getFixupKindInfo(MCFixupKind Kind) const {
|
||||
{ "fixup_MICROMIPS_HI16", 16, 16, 0 },
|
||||
{ "fixup_MICROMIPS_LO16", 16, 16, 0 },
|
||||
{ "fixup_MICROMIPS_GOT16", 16, 16, 0 },
|
||||
{ "fixup_MICROMIPS_PC7_S1", 9, 7, MCFixupKindInfo::FKF_IsPCRel },
|
||||
{ "fixup_MICROMIPS_PC16_S1",16, 16, MCFixupKindInfo::FKF_IsPCRel },
|
||||
{ "fixup_MICROMIPS_CALL16", 16, 16, 0 },
|
||||
{ "fixup_MICROMIPS_GOT_DISP", 16, 16, 0 },
|
||||
|
||||
Reference in New Issue
Block a user