[llvm-commits] CVS: llvm/lib/Target/X86/X86JITInfo.cpp
Evan Cheng
evan.cheng at apple.com
Wed Mar 14 03:48:26 PDT 2007
Changes in directory llvm/lib/Target/X86:
X86JITInfo.cpp updated: 1.35 -> 1.36
---
Log message:
x86-64 JIT stub codegen.
---
Diffs of the changes: (+11 -0)
X86JITInfo.cpp | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: llvm/lib/Target/X86/X86JITInfo.cpp
diff -u llvm/lib/Target/X86/X86JITInfo.cpp:1.35 llvm/lib/Target/X86/X86JITInfo.cpp:1.36
--- llvm/lib/Target/X86/X86JITInfo.cpp:1.35 Wed Mar 14 05:44:30 2007
+++ llvm/lib/Target/X86/X86JITInfo.cpp Wed Mar 14 05:48:08 2007
@@ -306,10 +306,21 @@
bool NotCC = Fn != (void*)(intptr_t)X86CompilationCallback;
#endif
if (NotCC) {
+#ifdef __x86_64__
+ MCE.startFunctionStub(13, 4);
+ MCE.emitByte(0x49); // REX prefix
+ MCE.emitByte(0xB8+2); // movabsq r10
+ MCE.emitWordLE(((unsigned *)&Fn)[0]);
+ MCE.emitWordLE(((unsigned *)&Fn)[1]);
+ MCE.emitByte(0x41); // REX prefix
+ MCE.emitByte(0xFF); // jmpq *r10
+ MCE.emitByte(2 | (4 << 3) | (3 << 6));
+#else
MCE.startFunctionStub(5, 4);
MCE.emitByte(0xE9);
MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4);
return MCE.finishFunctionStub(0);
+#endif
}
#ifdef __x86_64__
More information about the llvm-commits
mailing list