2006-02-05 05:50:24 +00:00
|
|
|
//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===//
|
2006-01-26 06:51:21 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Chris Lattner and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the SPARC specific subclass of TargetSubtarget.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
#include "SparcSubtarget.h"
|
|
|
|
#include "SparcGenSubtarget.inc"
|
2006-01-26 06:51:21 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2006-01-30 04:57:43 +00:00
|
|
|
// 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"));
|
|
|
|
}
|
|
|
|
|
2006-02-05 05:50:24 +00:00
|
|
|
SparcSubtarget::SparcSubtarget(const Module &M, const std::string &FS) {
|
2006-01-27 22:38:36 +00:00
|
|
|
// Set the default features.
|
|
|
|
IsV9 = false;
|
|
|
|
V8DeprecatedInsts = false;
|
|
|
|
IsVIS = false;
|
|
|
|
|
2006-01-26 06:51:21 +00:00
|
|
|
// Determine default and user specified characteristics
|
|
|
|
std::string CPU = "generic";
|
|
|
|
|
|
|
|
// FIXME: autodetect host here!
|
2006-01-30 04:57:43 +00:00
|
|
|
CPU = "v9"; // What is a good way to detect V9?
|
2006-01-26 06:51:21 +00:00
|
|
|
|
|
|
|
// Parse features string.
|
|
|
|
ParseSubtargetFeatures(FS, CPU);
|
|
|
|
|
2006-01-30 04:57:43 +00:00
|
|
|
// Unless explicitly enabled, disable the V9 instructions.
|
|
|
|
if (!EnableV9)
|
|
|
|
IsV9 = false;
|
2006-05-24 17:04:05 +00:00
|
|
|
}
|