[llvm-commits] [llvm] r95438 - in /llvm/trunk/lib/Target/X86: X86.h X86CodeEmitter.cpp X86MCCodeEmitter.cpp
Chris Lattner
sabre at nondot.org
Fri Feb 5 13:51:35 PST 2010
Author: lattner
Date: Fri Feb 5 15:51:35 2010
New Revision: 95438
URL: http://llvm.org/viewvc/llvm-project?rev=95438&view=rev
Log:
wire up 64-bit MCCodeEmitter.
Modified:
llvm/trunk/lib/Target/X86/X86.h
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/X86/X86.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86.h?rev=95438&r1=95437&r2=95438&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86.h (original)
+++ llvm/trunk/lib/Target/X86/X86.h Fri Feb 5 15:51:35 2010
@@ -50,7 +50,8 @@
JITCodeEmitter &JCE);
MCCodeEmitter *createHeinousX86MCCodeEmitter(const Target &, TargetMachine &TM);
-MCCodeEmitter *createX86MCCodeEmitter(const Target &, TargetMachine &TM);
+MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM);
+MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM);
/// createX86EmitCodeToMemory - Returns a pass that converts a register
/// allocated function into raw machine code in a dynamically
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=95438&r1=95437&r2=95438&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Fri Feb 5 15:51:35 2010
@@ -1117,8 +1117,11 @@
TargetMachine &TM) {
// FIXME: Remove the heinous one when the new one works.
- if (EnableNewEncoder)
- return createX86MCCodeEmitter(T, TM);
+ if (EnableNewEncoder) {
+ if (TM.getTargetData()->getPointerSize() == 4)
+ return createX86_32MCCodeEmitter(T, TM);
+ return createX86_64MCCodeEmitter(T, TM);
+ }
return new X86MCCodeEmitter(static_cast<X86TargetMachine&>(TM));
}
Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=95438&r1=95437&r2=95438&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Fri Feb 5 15:51:35 2010
@@ -27,10 +27,9 @@
const TargetInstrInfo &TII;
bool Is64BitMode;
public:
- X86MCCodeEmitter(TargetMachine &tm)
+ X86MCCodeEmitter(TargetMachine &tm, bool is64Bit)
: TM(tm), TII(*TM.getInstrInfo()) {
- // FIXME: Get this from the right place.
- Is64BitMode = false;
+ Is64BitMode = is64Bit;
}
~X86MCCodeEmitter() {}
@@ -83,9 +82,14 @@
} // end anonymous namespace
-MCCodeEmitter *llvm::createX86MCCodeEmitter(const Target &,
- TargetMachine &TM) {
- return new X86MCCodeEmitter(TM);
+MCCodeEmitter *llvm::createX86_32MCCodeEmitter(const Target &,
+ TargetMachine &TM) {
+ return new X86MCCodeEmitter(TM, false);
+}
+
+MCCodeEmitter *llvm::createX86_64MCCodeEmitter(const Target &,
+ TargetMachine &TM) {
+ return new X86MCCodeEmitter(TM, true);
}
More information about the llvm-commits
mailing list