forked from OSchip/llvm-project
Revert part of 70929 that has to do with determining whether a SIB byte is needed. It causes a lot of x86_64 JIT failures.
llvm-svn: 70986
This commit is contained in:
parent
eaefb3a8ca
commit
a35aed567a
|
@ -338,8 +338,8 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI,
|
||||||
unsigned BaseReg = Base.getReg();
|
unsigned BaseReg = Base.getReg();
|
||||||
|
|
||||||
// Is a SIB byte needed?
|
// Is a SIB byte needed?
|
||||||
if (IndexReg.getReg() == 0 && (!Is64BitMode || BaseReg != 0) &&
|
if ((!Is64BitMode || DispForReloc) && IndexReg.getReg() == 0 &&
|
||||||
(BaseReg == 0 || getX86RegNum(BaseReg) != N86::ESP)) {
|
(BaseReg == 0 || getX86RegNum(BaseReg) != N86::ESP)) {
|
||||||
if (BaseReg == 0) { // Just a displacement?
|
if (BaseReg == 0) { // Just a displacement?
|
||||||
// Emit special case [disp32] encoding
|
// Emit special case [disp32] encoding
|
||||||
MCE.emitByte(ModRMByte(0, RegOpcodeField, 5));
|
MCE.emitByte(ModRMByte(0, RegOpcodeField, 5));
|
||||||
|
|
|
@ -2811,7 +2811,7 @@ static unsigned getMemModRMByteSize(const MachineInstr &MI, unsigned Op,
|
||||||
unsigned BaseReg = Base.getReg();
|
unsigned BaseReg = Base.getReg();
|
||||||
|
|
||||||
// Is a SIB byte needed?
|
// Is a SIB byte needed?
|
||||||
if (IndexReg.getReg() == 0 && (!Is64BitMode || BaseReg != 0) &&
|
if ((!Is64BitMode || DispForReloc) && IndexReg.getReg() == 0 &&
|
||||||
(BaseReg == 0 || X86RegisterInfo::getX86RegNum(BaseReg) != N86::ESP)) {
|
(BaseReg == 0 || X86RegisterInfo::getX86RegNum(BaseReg) != N86::ESP)) {
|
||||||
if (BaseReg == 0) { // Just a displacement?
|
if (BaseReg == 0) { // Just a displacement?
|
||||||
// Emit special case [disp32] encoding
|
// Emit special case [disp32] encoding
|
||||||
|
|
Loading…
Reference in New Issue