dont' call getX86RegNum on X86::RIP, it doesn't like that. This
authorChris Lattner <sabre@nondot.org>
Thu, 11 Feb 2010 08:45:56 +0000 (08:45 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 11 Feb 2010 08:45:56 +0000 (08:45 +0000)
fixes the remaining x86-64 jit failures afaik.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95867 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86CodeEmitter.cpp
lib/Target/X86/X86MCCodeEmitter.cpp

index bcf3f15d423ec2dfc584efe99b668c04b064150b..6d5fa8da0d893182115cb49fca2558c051147de2 100644 (file)
@@ -387,7 +387,9 @@ void Emitter<CodeEmitter>::emitMemModRMByte(const MachineInstr &MI,
   // If no BaseReg, issue a RIP relative instruction only if the MCE can 
   // resolve addresses on-the-fly, otherwise use SIB (Intel Manual 2A, table
   // 2-7) and absolute references.
-  unsigned BaseRegNo = BaseReg != 0 ? getX86RegNum(BaseReg) : -1U;
+  unsigned BaseRegNo = -1U;
+  if (BaseReg != 0 && BaseReg != X86::RIP)
+    BaseRegNo = getX86RegNum(BaseReg);
 
   if (// The SIB byte must be used if there is an index register.
       IndexReg.getReg() == 0 && 
index ef1733f99398ee20247899cb15fd1107a70396af..ba1bdc7851d85b06da5735fca45b49e206af7545 100644 (file)
@@ -175,8 +175,10 @@ void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op,
   const MCOperand &Scale    = MI.getOperand(Op+1);
   const MCOperand &IndexReg = MI.getOperand(Op+2);
   unsigned BaseReg = Base.getReg();
-  unsigned BaseRegNo = BaseReg != 0 ? GetX86RegNum(Base) : -1U;
-
+  unsigned BaseRegNo = -1U;
+  if (BaseReg != 0 && BaseReg != X86::RIP)
+    BaseRegNo = GetX86RegNum(Base);
+  
   // Determine whether a SIB byte is needed.
   // If no BaseReg, issue a RIP relative instruction only if the MCE can 
   // resolve addresses on-the-fly, otherwise use SIB (Intel Manual 2A, table