blob: 3f7b23ad95fd809ac34b991f32bf161d9de96a35 [file] [log] [blame]
Chris Lattner7c90f732006-02-05 05:50:24 +00001//===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===//
Chris Lattner0d170a72006-01-26 06:51:21 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-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 Lattner0d170a72006-01-26 06:51:21 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the SPARC specific subclass of TargetSubtarget.
11//
12//===----------------------------------------------------------------------===//
13
Chris Lattner7c90f732006-02-05 05:50:24 +000014#include "SparcSubtarget.h"
Evan Cheng94214702011-07-01 20:45:01 +000015
16#define GET_SUBTARGETINFO_CTOR
17#define GET_SUBTARGETINFO_MC_DESC
18#define GET_SUBTARGETINFO_TARGET_DESC
Chris Lattner7c90f732006-02-05 05:50:24 +000019#include "SparcGenSubtarget.inc"
Evan Cheng94214702011-07-01 20:45:01 +000020
Chris Lattner0d170a72006-01-26 06:51:21 +000021using namespace llvm;
22
Evan Cheng276365d2011-06-30 01:53:36 +000023SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
24 const std::string &FS, bool is64Bit) :
Evan Cheng94214702011-07-01 20:45:01 +000025 SparcGenSubtargetInfo(),
Chris Lattner87c06d62010-02-04 06:34:01 +000026 IsV9(false),
27 V8DeprecatedInsts(false),
28 IsVIS(false),
29 Is64Bit(is64Bit) {
Chris Lattner184cc4a2006-01-27 22:38:36 +000030
Chris Lattner0d170a72006-01-26 06:51:21 +000031 // Determine default and user specified characteristics
Evan Cheng276365d2011-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 Lattner87c06d62010-02-04 06:34:01 +000038 }
Evan Cheng276365d2011-06-30 01:53:36 +000039 IsV9 = CPUName == "v9";
Chris Lattner0d170a72006-01-26 06:51:21 +000040
Chris Lattner0d170a72006-01-26 06:51:21 +000041 // Parse features string.
Evan Cheng276365d2011-06-30 01:53:36 +000042 ParseSubtargetFeatures(FS, CPUName);
Chris Lattnerd74ea2b2006-05-24 17:04:05 +000043}