[llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Mon Dec 4 23:30:10 PST 2006
Changes in directory llvm/lib/Target/X86:
X86CodeEmitter.cpp updated: 1.125 -> 1.126
---
Log message:
JIT large code model support.
---
Diffs of the changes: (+13 -7)
X86CodeEmitter.cpp | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/X86/X86CodeEmitter.cpp
diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.125 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.126
--- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.125 Mon Dec 4 22:01:03 2006
+++ llvm/lib/Target/X86/X86CodeEmitter.cpp Tue Dec 5 01:29:55 2006
@@ -173,6 +173,8 @@
unsigned PCAdj /* = 0 */) {
MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
Reloc, CPI, PCAdj));
+ if (Reloc == X86::reloc_absolute_dword)
+ MCE.emitWordLE(0);
MCE.emitWordLE(Disp); // The relocated value will be added to the displacement
}
@@ -183,6 +185,8 @@
unsigned PCAdj /* = 0 */) {
MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
Reloc, JTI, PCAdj));
+ if (Reloc == X86::reloc_absolute_dword)
+ MCE.emitWordLE(0);
MCE.emitWordLE(0); // The relocated value will be added to the displacement
}
@@ -617,7 +621,7 @@
unsigned CurOp = 0;
if (NumOps > 1 && Desc->getOperandConstraint(1, TOI::TIED_TO) != -1)
CurOp++;
-
+
unsigned char BaseOpcode = II->getBaseOpcodeFor(Desc);
switch (Desc->TSFlags & X86II::FormMask) {
default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!");
@@ -675,9 +679,8 @@
emitConstant(MO1.getImm(), Size);
else {
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_absolute_word;
- // FIXME
if (Opcode == X86::MOV64ri)
- rt = X86::reloc_absolute_dword;
+ rt = X86::reloc_absolute_dword; // FIXME: add X86II flag?
if (MO1.isGlobalAddress())
emitGlobalAddressForPtr(MO1.getGlobal(), rt, MO1.getOffset());
else if (MO1.isExternalSymbol())
@@ -743,10 +746,10 @@
if (MO1.isImmediate())
emitConstant(MO1.getImm(), Size);
else {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_absolute_word;
- // FIXME
+ unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
+ : X86::reloc_absolute_word;
if (Opcode == X86::MOV64ri32)
- rt = X86::reloc_absolute_word;
+ rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
if (MO1.isGlobalAddress())
emitGlobalAddressForPtr(MO1.getGlobal(), rt, MO1.getOffset());
else if (MO1.isExternalSymbol())
@@ -777,7 +780,10 @@
if (MO.isImmediate())
emitConstant(MO.getImm(), Size);
else {
- unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_absolute_word;
+ unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
+ : X86::reloc_absolute_word;
+ if (Opcode == X86::MOV64mi32)
+ rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
if (MO.isGlobalAddress())
emitGlobalAddressForPtr(MO.getGlobal(), rt, MO.getOffset());
else if (MO.isExternalSymbol())
More information about the llvm-commits
mailing list