summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86JITInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-09-03 04:37:05 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-09-03 04:37:05 +0000
commit47455a79aeb7ce90a09873bfd9aa1cbf409696ec (patch)
tree089c9a9624628e46e8ebc2e4d341cca54f6daaee /llvm/lib/Target/X86/X86JITInfo.cpp
parent231dd7169dd24f87e6e460d1c4b6681e040fb23d (diff)
downloadbcm5719-llvm-47455a79aeb7ce90a09873bfd9aa1cbf409696ec.tar.gz
bcm5719-llvm-47455a79aeb7ce90a09873bfd9aa1cbf409696ec.zip
X86JITInfo::getLazyResolverFunction() should not read cpu id to determine whether sse is available. Just use consult subtarget.
No functionality changes. llvm-svn: 80880
Diffstat (limited to 'llvm/lib/Target/X86/X86JITInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86JITInfo.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/llvm/lib/Target/X86/X86JITInfo.cpp b/llvm/lib/Target/X86/X86JITInfo.cpp
index d36f87a0801..2c0302ffee6 100644
--- a/llvm/lib/Target/X86/X86JITInfo.cpp
+++ b/llvm/lib/Target/X86/X86JITInfo.cpp
@@ -15,6 +15,7 @@
#include "X86JITInfo.h"
#include "X86Relocations.h"
#include "X86Subtarget.h"
+#include "X86TargetMachine.h"
#include "llvm/Function.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
@@ -407,24 +408,14 @@ TargetJITInfo::LazyResolverFn
X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
JITCompilerFunction = F;
-#if defined (X86_32_JIT) && !defined (_MSC_VER)
- unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
- union {
- unsigned u[3];
- char c[12];
- } text;
-
- if (!X86::GetCpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1)) {
- // FIXME: support for AMD family of processors.
- if (memcmp(text.c, "GenuineIntel", 12) == 0) {
- X86::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
- if ((EDX >> 25) & 0x1)
- return X86CompilationCallback_SSE;
- }
- }
-#endif
+ return Subtarget->hasSSE1()
+ ? X86CompilationCallback_SSE : X86CompilationCallback;
+}
- return X86CompilationCallback;
+X86JITInfo::X86JITInfo(X86TargetMachine &tm) : TM(tm) {
+ Subtarget = &TM.getSubtarget<X86Subtarget>();
+ useGOT = 0;
+ TLSOffset = 0;
}
void *X86JITInfo::emitGlobalValueIndirectSym(const GlobalValue* GV, void *ptr,
OpenPOWER on IntegriCloud