aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Sparc/SparcSubtarget.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-04 06:34:01 +0000
committerChris Lattner <sabre@nondot.org>2010-02-04 06:34:01 +0000
commit8228b11abc7da31f1e49e3c4342f9dcb01ec4dc1 (patch)
treea96f064d31d161b59e994f62c64829b01f7ead27 /llvm/lib/Target/Sparc/SparcSubtarget.cpp
parent21fb024cc017242b8082d2535053ed959fc0d0e8 (diff)
downloadllvm-8228b11abc7da31f1e49e3c4342f9dcb01ec4dc1.zip
llvm-8228b11abc7da31f1e49e3c4342f9dcb01ec4dc1.tar.gz
llvm-8228b11abc7da31f1e49e3c4342f9dcb01ec4dc1.tar.bz2
add support for the sparcv9-*-* target triple to turn on
64-bit sparc codegen. Patch by Nathan Keynes! llvm-svn: 95293
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcSubtarget.cpp')
-rw-r--r--llvm/lib/Target/Sparc/SparcSubtarget.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/llvm/lib/Target/Sparc/SparcSubtarget.cpp b/llvm/lib/Target/Sparc/SparcSubtarget.cpp
index 8a88cc0..ce11af1 100644
--- a/llvm/lib/Target/Sparc/SparcSubtarget.cpp
+++ b/llvm/lib/Target/Sparc/SparcSubtarget.cpp
@@ -15,29 +15,20 @@
#include "SparcGenSubtarget.inc"
using namespace llvm;
-// FIXME: temporary.
-#include "llvm/Support/CommandLine.h"
-namespace {
- cl::opt<bool> EnableV9("enable-sparc-v9-insts", cl::Hidden,
- cl::desc("Enable V9 instructions in the V8 target"));
-}
-
-SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &FS) {
- // Set the default features.
- IsV9 = false;
- V8DeprecatedInsts = false;
- IsVIS = false;
+SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &FS,
+ bool is64Bit) :
+ IsV9(false),
+ V8DeprecatedInsts(false),
+ IsVIS(false),
+ Is64Bit(is64Bit) {
// Determine default and user specified characteristics
- std::string CPU = "generic";
+ const char *CPU = "v8";
+ if (is64Bit) {
+ CPU = "v9";
+ IsV9 = true;
+ }
- // FIXME: autodetect host here!
- CPU = "v9"; // What is a good way to detect V9?
-
// Parse features string.
ParseSubtargetFeatures(FS, CPU);
-
- // Unless explicitly enabled, disable the V9 instructions.
- if (!EnableV9)
- IsV9 = false;
}