mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
ConstantPoolIndex is now the displacement portion of the address (rather
than base). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
38b7327ec0
commit
140a4c4868
@ -239,6 +239,9 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI,
|
|||||||
if (Op3.isGlobalAddress()) {
|
if (Op3.isGlobalAddress()) {
|
||||||
GV = Op3.getGlobal();
|
GV = Op3.getGlobal();
|
||||||
DispVal = Op3.getOffset();
|
DispVal = Op3.getOffset();
|
||||||
|
} else if (Op3.isConstantPoolIndex()) {
|
||||||
|
DispVal += MCE.getConstantPoolEntryAddress(Op3.getConstantPoolIndex());
|
||||||
|
DispVal += Op3.getOffset();
|
||||||
} else {
|
} else {
|
||||||
DispVal = Op3.getImmedValue();
|
DispVal = Op3.getImmedValue();
|
||||||
}
|
}
|
||||||
@ -247,16 +250,7 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI,
|
|||||||
const MachineOperand &Scale = MI.getOperand(Op+1);
|
const MachineOperand &Scale = MI.getOperand(Op+1);
|
||||||
const MachineOperand &IndexReg = MI.getOperand(Op+2);
|
const MachineOperand &IndexReg = MI.getOperand(Op+2);
|
||||||
|
|
||||||
unsigned BaseReg = 0;
|
unsigned BaseReg = Base.getReg();
|
||||||
|
|
||||||
if (Base.isConstantPoolIndex()) {
|
|
||||||
// Emit a direct address reference [disp32] where the displacement of the
|
|
||||||
// constant pool entry is controlled by the MCE.
|
|
||||||
assert(!GV && "Constant Pool reference cannot be relative to global!");
|
|
||||||
DispVal += MCE.getConstantPoolEntryAddress(Base.getConstantPoolIndex());
|
|
||||||
} else {
|
|
||||||
BaseReg = Base.getReg();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Is a SIB byte needed?
|
// Is a SIB byte needed?
|
||||||
if (IndexReg.getReg() == 0 && BaseReg != X86::ESP) {
|
if (IndexReg.getReg() == 0 && BaseReg != X86::ESP) {
|
||||||
|
Loading…
Reference in New Issue
Block a user