diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
commit | 009b1c42aa6266385f2c37e227516b24077e6dd7 (patch) | |
tree | 64ba909838c23261cace781ece27d106134ea451 /lib/Target/Sparc/SparcSubtarget.cpp |
Diffstat (limited to 'lib/Target/Sparc/SparcSubtarget.cpp')
-rw-r--r-- | lib/Target/Sparc/SparcSubtarget.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcSubtarget.cpp b/lib/Target/Sparc/SparcSubtarget.cpp new file mode 100644 index 0000000000000..aaddbff073ad5 --- /dev/null +++ b/lib/Target/Sparc/SparcSubtarget.cpp @@ -0,0 +1,43 @@ +//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the SPARC specific subclass of TargetSubtarget. +// +//===----------------------------------------------------------------------===// + +#include "SparcSubtarget.h" +#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 Module &M, const std::string &FS) { + // Set the default features. + IsV9 = false; + V8DeprecatedInsts = false; + IsVIS = false; + + // Determine default and user specified characteristics + std::string CPU = "generic"; + + // 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; +} |