mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-11 02:21:40 +00:00
switch to target-indep fixups for 1/2/4/8 byte data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95920 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cb419d3c6f
commit
11eafa8bed
@ -23,11 +23,8 @@ using namespace llvm;
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace X86 {
|
namespace X86 {
|
||||||
enum Fixups {
|
enum Fixups {
|
||||||
// FIXME: This is just a stub.
|
reloc_pcrel_4byte = FirstTargetFixupKind, // 32-bit pcrel, e.g. a branch.
|
||||||
fixup_1byte_imm = FirstTargetFixupKind,
|
reloc_pcrel_1byte // 8-bit pcrel, e.g. branch_1
|
||||||
fixup_2byte_imm,
|
|
||||||
fixup_4byte_imm,
|
|
||||||
fixup_8byte_imm
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -48,15 +45,13 @@ public:
|
|||||||
~X86MCCodeEmitter() {}
|
~X86MCCodeEmitter() {}
|
||||||
|
|
||||||
unsigned getNumFixupKinds() const {
|
unsigned getNumFixupKinds() const {
|
||||||
return 4;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const {
|
MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const {
|
||||||
static MCFixupKindInfo Infos[] = {
|
static MCFixupKindInfo Infos[] = {
|
||||||
{ "fixup_1byte_imm", 0, 1 * 8 },
|
{ "reloc_pcrel_4byte", 0, 4 * 8 },
|
||||||
{ "fixup_2byte_imm", 0, 2 * 8 },
|
{ "reloc_pcrel_1byte", 0, 1 * 8 }
|
||||||
{ "fixup_4byte_imm", 0, 4 * 8 },
|
|
||||||
{ "fixup_8byte_imm", 0, 8 * 8 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(Kind >= FirstTargetFixupKind && Kind < MaxTargetFixupKind &&
|
assert(Kind >= FirstTargetFixupKind && Kind < MaxTargetFixupKind &&
|
||||||
@ -148,14 +143,14 @@ EmitImmediate(const MCOperand &DispOp, unsigned Size,
|
|||||||
// FIXME: Pass in the relocation type, this is just a hack..
|
// FIXME: Pass in the relocation type, this is just a hack..
|
||||||
unsigned FixupKind;
|
unsigned FixupKind;
|
||||||
if (Size == 1)
|
if (Size == 1)
|
||||||
FixupKind = X86::fixup_1byte_imm;
|
FixupKind = FK_Data_1;
|
||||||
else if (Size == 2)
|
else if (Size == 2)
|
||||||
FixupKind = X86::fixup_2byte_imm;
|
FixupKind = FK_Data_2;
|
||||||
else if (Size == 4)
|
else if (Size == 4)
|
||||||
FixupKind = X86::fixup_4byte_imm;
|
FixupKind = FK_Data_4;
|
||||||
else {
|
else {
|
||||||
assert(Size == 8 && "Unknown immediate size");
|
assert(Size == 8 && "Unknown immediate size");
|
||||||
FixupKind = X86::fixup_8byte_imm;
|
FixupKind = FK_Data_8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit a symbolic constant as a fixup and 4 zeros.
|
// Emit a symbolic constant as a fixup and 4 zeros.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user