2006-02-05 13:50:24 +08:00
|
|
|
//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-02-05 13:50:24 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2011-07-02 05:01:15 +08:00
|
|
|
// This file implements the SPARC specific subclass of TargetSubtargetInfo.
|
2006-02-05 13:50:24 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "SparcSubtarget.h"
|
2011-07-09 13:47:46 +08:00
|
|
|
#include "Sparc.h"
|
|
|
|
#include "llvm/Target/TargetRegistry.h"
|
2011-07-02 04:45:01 +08:00
|
|
|
|
|
|
|
#define GET_SUBTARGETINFO_TARGET_DESC
|
2011-07-08 09:53:10 +08:00
|
|
|
#define GET_SUBTARGETINFO_CTOR
|
2011-07-02 06:36:09 +08:00
|
|
|
#include "SparcGenSubtargetInfo.inc"
|
2011-07-02 04:45:01 +08:00
|
|
|
|
2006-02-05 13:50:24 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2011-06-30 09:53:36 +08:00
|
|
|
SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
|
|
|
|
const std::string &FS, bool is64Bit) :
|
2011-07-07 15:07:08 +08:00
|
|
|
SparcGenSubtargetInfo(TT, CPU, FS),
|
2010-02-04 14:34:01 +08:00
|
|
|
IsV9(false),
|
|
|
|
V8DeprecatedInsts(false),
|
|
|
|
IsVIS(false),
|
|
|
|
Is64Bit(is64Bit) {
|
2006-02-05 13:50:24 +08:00
|
|
|
|
|
|
|
// Determine default and user specified characteristics
|
2011-06-30 09:53:36 +08:00
|
|
|
std::string CPUName = CPU;
|
|
|
|
if (CPUName.empty()) {
|
|
|
|
if (is64Bit)
|
|
|
|
CPUName = "v9";
|
|
|
|
else
|
|
|
|
CPUName = "v8";
|
2010-02-04 14:34:01 +08:00
|
|
|
}
|
2011-06-30 09:53:36 +08:00
|
|
|
IsV9 = CPUName == "v9";
|
2006-02-05 13:50:24 +08:00
|
|
|
|
|
|
|
// Parse features string.
|
2011-07-07 15:07:08 +08:00
|
|
|
ParseSubtargetFeatures(CPUName, FS);
|
2006-05-25 01:04:05 +08:00
|
|
|
}
|