1 //===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the SPARC specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #include "SparcSubtarget.h"
16 #include "llvm/Target/TargetRegistry.h"
18 #define GET_SUBTARGETINFO_ENUM
19 #define GET_SUBTARGETINFO_MC_DESC
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "SparcGenSubtargetInfo.inc"
26 SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
27 const std::string &FS, bool is64Bit) :
28 SparcGenSubtargetInfo(TT, CPU, FS),
30 V8DeprecatedInsts(false),
34 // Determine default and user specified characteristics
35 std::string CPUName = CPU;
36 if (CPUName.empty()) {
42 IsV9 = CPUName == "v9";
44 // Parse features string.
45 ParseSubtargetFeatures(CPUName, FS);
48 MCSubtargetInfo *createSparcMCSubtargetInfo(StringRef TT, StringRef CPU,
50 MCSubtargetInfo *X = new MCSubtargetInfo();
51 InitSparcMCSubtargetInfo(X, TT, CPU, FS);
55 extern "C" void LLVMInitializeSparcMCSubtargetInfo() {
56 TargetRegistry::RegisterMCSubtargetInfo(TheSparcTarget,
57 createSparcMCSubtargetInfo);