blob: 3037b44afa5e7cd535d38e734d83f55e3a2b171a [file] [log] [blame]
Chris Lattner158e1f52006-02-05 05:50:24 +00001//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner158e1f52006-02-05 05:50:24 +00007//
8//===----------------------------------------------------------------------===//
9//
Evan Cheng0d639a22011-07-01 21:01:15 +000010// This file implements the SPARC specific subclass of TargetSubtargetInfo.
Chris Lattner158e1f52006-02-05 05:50:24 +000011//
12//===----------------------------------------------------------------------===//
13
14#include "SparcSubtarget.h"
Evan Cheng54b68e32011-07-01 20:45:01 +000015
16#define GET_SUBTARGETINFO_CTOR
17#define GET_SUBTARGETINFO_MC_DESC
18#define GET_SUBTARGETINFO_TARGET_DESC
Chris Lattner158e1f52006-02-05 05:50:24 +000019#include "SparcGenSubtarget.inc"
Evan Cheng54b68e32011-07-01 20:45:01 +000020
Chris Lattner158e1f52006-02-05 05:50:24 +000021using namespace llvm;
22
Evan Chengfe6e4052011-06-30 01:53:36 +000023SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
24 const std::string &FS, bool is64Bit) :
Evan Cheng54b68e32011-07-01 20:45:01 +000025 SparcGenSubtargetInfo(),
Chris Lattner8228b112010-02-04 06:34:01 +000026 IsV9(false),
27 V8DeprecatedInsts(false),
28 IsVIS(false),
29 Is64Bit(is64Bit) {
Chris Lattner158e1f52006-02-05 05:50:24 +000030
31 // Determine default and user specified characteristics
Evan Chengfe6e4052011-06-30 01:53:36 +000032 std::string CPUName = CPU;
33 if (CPUName.empty()) {
34 if (is64Bit)
35 CPUName = "v9";
36 else
37 CPUName = "v8";
Chris Lattner8228b112010-02-04 06:34:01 +000038 }
Evan Chengfe6e4052011-06-30 01:53:36 +000039 IsV9 = CPUName == "v9";
Chris Lattner158e1f52006-02-05 05:50:24 +000040
Chris Lattner158e1f52006-02-05 05:50:24 +000041 // Parse features string.
Evan Chengfe6e4052011-06-30 01:53:36 +000042 ParseSubtargetFeatures(FS, CPUName);
Chris Lattneraa2372562006-05-24 17:04:05 +000043}