blob: 6c501cff6a3ababd48215ab6c9625220720df910 [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 Cheng91111d22011-07-09 05:47:46 +000015#include "Sparc.h"
Evan Cheng2bb40352011-08-24 18:08:43 +000016#include "llvm/Support/TargetRegistry.h"
Evan Cheng54b68e32011-07-01 20:45:01 +000017
Evan Cheng54b68e32011-07-01 20:45:01 +000018#define GET_SUBTARGETINFO_TARGET_DESC
Evan Cheng4d1ca962011-07-08 01:53:10 +000019#define GET_SUBTARGETINFO_CTOR
Evan Chengc9c090d2011-07-01 22:36:09 +000020#include "SparcGenSubtargetInfo.inc"
Evan Cheng54b68e32011-07-01 20:45:01 +000021
Chris Lattner158e1f52006-02-05 05:50:24 +000022using namespace llvm;
23
Evan Chengfe6e4052011-06-30 01:53:36 +000024SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU,
25 const std::string &FS, bool is64Bit) :
Evan Cheng1a72add62011-07-07 07:07:08 +000026 SparcGenSubtargetInfo(TT, CPU, FS),
Chris Lattner8228b112010-02-04 06:34:01 +000027 IsV9(false),
28 V8DeprecatedInsts(false),
29 IsVIS(false),
30 Is64Bit(is64Bit) {
Chris Lattner158e1f52006-02-05 05:50:24 +000031
32 // Determine default and user specified characteristics
Evan Chengfe6e4052011-06-30 01:53:36 +000033 std::string CPUName = CPU;
34 if (CPUName.empty()) {
35 if (is64Bit)
36 CPUName = "v9";
37 else
38 CPUName = "v8";
Chris Lattner8228b112010-02-04 06:34:01 +000039 }
Evan Chengfe6e4052011-06-30 01:53:36 +000040 IsV9 = CPUName == "v9";
Chris Lattner158e1f52006-02-05 05:50:24 +000041
Chris Lattner158e1f52006-02-05 05:50:24 +000042 // Parse features string.
Evan Cheng1a72add62011-07-07 07:07:08 +000043 ParseSubtargetFeatures(CPUName, FS);
Chris Lattneraa2372562006-05-24 17:04:05 +000044}