mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Reverting 116059. Bots are unhappy with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116064 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const //===-- ARM/ARMCodeEmitter.cpp - Convert ARM code to machine code ---------===//
|
//===-- ARM/ARMCodeEmitter.cpp - Convert ARM code to machine code ---------===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@@ -150,9 +150,8 @@ namespace {
|
|||||||
|
|
||||||
/// getMachineOpValue - Return binary encoding of operand. If the machine
|
/// getMachineOpValue - Return binary encoding of operand. If the machine
|
||||||
/// operand requires relocation, record the relocation and return zero.
|
/// operand requires relocation, record the relocation and return zero.
|
||||||
unsigned getMachineOpValue(const MachineInstr &MI,
|
unsigned getMachineOpValue(const MachineInstr &MI,const MachineOperand &MO);
|
||||||
const MachineOperand &MO) const;
|
unsigned getMachineOpValue(const MachineInstr &MI, unsigned OpIdx) {
|
||||||
unsigned getMachineOpValue(const MachineInstr &MI, unsigned OpIdx) const {
|
|
||||||
return getMachineOpValue(MI, MI.getOperand(OpIdx));
|
return getMachineOpValue(MI, MI.getOperand(OpIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,12 +169,12 @@ namespace {
|
|||||||
/// fixed up by the relocation stage.
|
/// fixed up by the relocation stage.
|
||||||
void emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
|
void emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
|
||||||
bool MayNeedFarStub, bool Indirect,
|
bool MayNeedFarStub, bool Indirect,
|
||||||
intptr_t ACPV = 0) const;
|
intptr_t ACPV = 0);
|
||||||
void emitExternalSymbolAddress(const char *ES, unsigned Reloc) const;
|
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
|
||||||
void emitConstPoolAddress(unsigned CPI, unsigned Reloc) const;
|
void emitConstPoolAddress(unsigned CPI, unsigned Reloc);
|
||||||
void emitJumpTableAddress(unsigned JTIndex, unsigned Reloc) const;
|
void emitJumpTableAddress(unsigned JTIndex, unsigned Reloc);
|
||||||
void emitMachineBasicBlock(MachineBasicBlock *BB, unsigned Reloc,
|
void emitMachineBasicBlock(MachineBasicBlock *BB, unsigned Reloc,
|
||||||
intptr_t JTBase = 0) const;
|
intptr_t JTBase = 0);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +262,7 @@ unsigned ARMCodeEmitter::getMovi32Value(const MachineInstr &MI,
|
|||||||
/// getMachineOpValue - Return binary encoding of operand. If the machine
|
/// getMachineOpValue - Return binary encoding of operand. If the machine
|
||||||
/// operand requires relocation, record the relocation and return zero.
|
/// operand requires relocation, record the relocation and return zero.
|
||||||
unsigned ARMCodeEmitter::getMachineOpValue(const MachineInstr &MI,
|
unsigned ARMCodeEmitter::getMachineOpValue(const MachineInstr &MI,
|
||||||
const MachineOperand &MO) const {
|
const MachineOperand &MO) {
|
||||||
if (MO.isReg())
|
if (MO.isReg())
|
||||||
return getARMRegisterNumbering(MO.getReg());
|
return getARMRegisterNumbering(MO.getReg());
|
||||||
else if (MO.isImm())
|
else if (MO.isImm())
|
||||||
@@ -295,7 +294,7 @@ unsigned ARMCodeEmitter::getMachineOpValue(const MachineInstr &MI,
|
|||||||
///
|
///
|
||||||
void ARMCodeEmitter::emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
|
void ARMCodeEmitter::emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
|
||||||
bool MayNeedFarStub, bool Indirect,
|
bool MayNeedFarStub, bool Indirect,
|
||||||
intptr_t ACPV) const {
|
intptr_t ACPV) {
|
||||||
MachineRelocation MR = Indirect
|
MachineRelocation MR = Indirect
|
||||||
? MachineRelocation::getIndirectSymbol(MCE.getCurrentPCOffset(), Reloc,
|
? MachineRelocation::getIndirectSymbol(MCE.getCurrentPCOffset(), Reloc,
|
||||||
const_cast<GlobalValue *>(GV),
|
const_cast<GlobalValue *>(GV),
|
||||||
@@ -309,8 +308,7 @@ void ARMCodeEmitter::emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
|
|||||||
/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
|
/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
|
||||||
/// be emitted to the current location in the function, and allow it to be PC
|
/// be emitted to the current location in the function, and allow it to be PC
|
||||||
/// relative.
|
/// relative.
|
||||||
void ARMCodeEmitter::
|
void ARMCodeEmitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) {
|
||||||
emitExternalSymbolAddress(const char *ES, unsigned Reloc) const {
|
|
||||||
MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
|
MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
|
||||||
Reloc, ES));
|
Reloc, ES));
|
||||||
}
|
}
|
||||||
@@ -318,7 +316,7 @@ emitExternalSymbolAddress(const char *ES, unsigned Reloc) const {
|
|||||||
/// emitConstPoolAddress - Arrange for the address of an constant pool
|
/// emitConstPoolAddress - Arrange for the address of an constant pool
|
||||||
/// to be emitted to the current location in the function, and allow it to be PC
|
/// to be emitted to the current location in the function, and allow it to be PC
|
||||||
/// relative.
|
/// relative.
|
||||||
void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc) const {
|
void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc) {
|
||||||
// Tell JIT emitter we'll resolve the address.
|
// Tell JIT emitter we'll resolve the address.
|
||||||
MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
|
MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
|
||||||
Reloc, CPI, 0, true));
|
Reloc, CPI, 0, true));
|
||||||
@@ -327,16 +325,14 @@ void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc) const {
|
|||||||
/// emitJumpTableAddress - Arrange for the address of a jump table to
|
/// emitJumpTableAddress - Arrange for the address of a jump table to
|
||||||
/// be emitted to the current location in the function, and allow it to be PC
|
/// be emitted to the current location in the function, and allow it to be PC
|
||||||
/// relative.
|
/// relative.
|
||||||
void ARMCodeEmitter::
|
void ARMCodeEmitter::emitJumpTableAddress(unsigned JTIndex, unsigned Reloc) {
|
||||||
emitJumpTableAddress(unsigned JTIndex, unsigned Reloc) const {
|
|
||||||
MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
|
MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
|
||||||
Reloc, JTIndex, 0, true));
|
Reloc, JTIndex, 0, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// emitMachineBasicBlock - Emit the specified address basic block.
|
/// emitMachineBasicBlock - Emit the specified address basic block.
|
||||||
void ARMCodeEmitter::emitMachineBasicBlock(MachineBasicBlock *BB,
|
void ARMCodeEmitter::emitMachineBasicBlock(MachineBasicBlock *BB,
|
||||||
unsigned Reloc,
|
unsigned Reloc, intptr_t JTBase) {
|
||||||
intptr_t JTBase) const {
|
|
||||||
MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
|
MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
|
||||||
Reloc, BB, JTBase));
|
Reloc, BB, JTBase));
|
||||||
}
|
}
|
||||||
|
@@ -44,8 +44,8 @@ public:
|
|||||||
|
|
||||||
/// getMachineOpValue - Return binary encoding of operand. If the machine
|
/// getMachineOpValue - Return binary encoding of operand. If the machine
|
||||||
/// operand requires relocation, record the relocation and return zero.
|
/// operand requires relocation, record the relocation and return zero.
|
||||||
unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO) const;
|
unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO);
|
||||||
unsigned getMachineOpValue(const MCInst &MI, unsigned OpIdx) const {
|
unsigned getMachineOpValue(const MCInst &MI, unsigned OpIdx) {
|
||||||
return getMachineOpValue(MI, MI.getOperand(OpIdx));
|
return getMachineOpValue(MI, MI.getOperand(OpIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,13 +120,17 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
++MCNumEmitted; // Keep track of the # of mi's emitted
|
++MCNumEmitted; // Keep track of the # of mi's emitted
|
||||||
switch (Opcode) {
|
switch (TSFlags & ARMII::FormMask) {
|
||||||
//FIXME: Any non-pseudos that need special handling, if there are any...
|
case ARMII::BrMiscFrm:
|
||||||
default: {
|
case ARMII::MiscFrm: {
|
||||||
unsigned Value = getBinaryCodeForInstr(MI);
|
unsigned Value = getBinaryCodeForInstr(MI);
|
||||||
EmitConstant(Value, 4, CurByte, OS);
|
EmitConstant(Value, 4, CurByte, OS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
llvm_unreachable("Unhandled instruction encoding format!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user