From 45d89644ae2f3296e4a07657c1aa81c365a1dcd0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 9 Feb 2010 21:21:26 +0000 Subject: [PATCH] revert r95689: getX86RegNum(BaseReg) != N86::ESP is a confusing idiom to check for ESP or RSP. llvm-svn: 95690 --- llvm/lib/Target/X86/X86CodeEmitter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/X86/X86CodeEmitter.cpp b/llvm/lib/Target/X86/X86CodeEmitter.cpp index 3f7c42559b2b..859eb909d944 100644 --- a/llvm/lib/Target/X86/X86CodeEmitter.cpp +++ b/llvm/lib/Target/X86/X86CodeEmitter.cpp @@ -389,8 +389,8 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI, // 2-7) and absolute references. if ((!Is64BitMode || DispForReloc || BaseReg != 0) && IndexReg.getReg() == 0 && - ((BaseReg == 0 && IsPCRel) || BaseReg == X86::RIP || - (BaseReg != 0 && BaseReg != X86::ESP))) { + ((BaseReg == 0 && MCE.earlyResolveAddresses()) || BaseReg == X86::RIP || + (BaseReg != 0 && getX86RegNum(BaseReg) != N86::ESP))) { if (BaseReg == 0 || BaseReg == X86::RIP) { // Just a displacement? // Emit special case [disp32] encoding MCE.emitByte(ModRMByte(0, RegOpcodeField, 5));