blob: 06bfc64ab8ee72cdf69679c9a6c1a6c6a901513d [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"
15#include "SparcGenSubtarget.inc"
Chris Lattner0d170a72006-01-26 06:51:21 +000016using namespace llvm;
17
Evan Cheng276365d2011-06-30 01:53:36 +000018SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
19 const std::string &FS, bool is64Bit) :
Chris Lattner87c06d62010-02-04 06:34:01 +000020 IsV9(false),
21 V8DeprecatedInsts(false),
22 IsVIS(false),
23 Is64Bit(is64Bit) {
Chris Lattner184cc4a2006-01-27 22:38:36 +000024
Chris Lattner0d170a72006-01-26 06:51:21 +000025 // Determine default and user specified characteristics
Evan Cheng276365d2011-06-30 01:53:36 +000026 std::string CPUName = CPU;
27 if (CPUName.empty()) {
28 if (is64Bit)
29 CPUName = "v9";
30 else
31 CPUName = "v8";
Chris Lattner87c06d62010-02-04 06:34:01 +000032 }
Evan Cheng276365d2011-06-30 01:53:36 +000033 IsV9 = CPUName == "v9";
Chris Lattner0d170a72006-01-26 06:51:21 +000034
Chris Lattner0d170a72006-01-26 06:51:21 +000035 // Parse features string.
Evan Cheng276365d2011-06-30 01:53:36 +000036 ParseSubtargetFeatures(FS, CPUName);
Chris Lattnerd74ea2b2006-05-24 17:04:05 +000037}