aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/SparcTargetMachine.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-10-09 05:57:01 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-10-09 05:57:01 +0000
commit0e2d466ce9b5e1b2d35f53993cd5d1ba64e4b45d (patch)
tree96bcc3285c61c4233890699b0d26ce5ebd12e92b /lib/Target/Sparc/SparcTargetMachine.cpp
parent930f475604bcd8835197df0dac0c63235f8f1bb3 (diff)
Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
default 32/BE target on sparc hosts, and ppc will continue to be the default on other hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/SparcTargetMachine.cpp')
-rw-r--r--lib/Target/Sparc/SparcTargetMachine.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp
index ab9316478f..a6b69d6263 100644
--- a/lib/Target/Sparc/SparcTargetMachine.cpp
+++ b/lib/Target/Sparc/SparcTargetMachine.cpp
@@ -35,6 +35,25 @@ SparcV8TargetMachine::SparcV8TargetMachine(const Module &M,
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0), JITInfo(*this) {
}
+unsigned SparcV8TargetMachine::getJITMatchQuality() {
+ return 0; // No JIT yet.
+}
+
+unsigned SparcV8TargetMachine::getModuleMatchQuality(const Module &M) {
+ if (M.getEndianness() == Module::BigEndian &&
+ M.getPointerSize() == Module::Pointer32)
+#ifdef __sparc__
+ return 20; // BE/32 ==> Prefer sparcv8 on sparc
+#else
+ return 5; // BE/32 ==> Prefer ppc elsewhere
+#endif
+ else if (M.getEndianness() != Module::AnyEndianness ||
+ M.getPointerSize() != Module::AnyPointerSize)
+ return 0; // Match for some other target
+
+ return getJITMatchQuality()/2;
+}
+
/// addPassesToEmitAssembly - Add passes to the specified pass manager
/// to implement a static compiler for this target.
///