Chris Lattner | 7c90f73 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 1 | //===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===// |
Chris Lattner | 0d170a7 | 2006-01-26 06:51:21 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Chris Lattner | 0d170a7 | 2006-01-26 06:51:21 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the SPARC specific subclass of TargetSubtarget. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Chris Lattner | 7c90f73 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 14 | #include "SparcSubtarget.h" |
Evan Cheng | 9421470 | 2011-07-01 20:45:01 +0000 | [diff] [blame^] | 15 | |
| 16 | #define GET_SUBTARGETINFO_CTOR |
| 17 | #define GET_SUBTARGETINFO_MC_DESC |
| 18 | #define GET_SUBTARGETINFO_TARGET_DESC |
Chris Lattner | 7c90f73 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 19 | #include "SparcGenSubtarget.inc" |
Evan Cheng | 9421470 | 2011-07-01 20:45:01 +0000 | [diff] [blame^] | 20 | |
Chris Lattner | 0d170a7 | 2006-01-26 06:51:21 +0000 | [diff] [blame] | 21 | using namespace llvm; |
| 22 | |
Evan Cheng | 276365d | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 23 | SparcSubtarget::SparcSubtarget(const std::string &TT, const std::string &CPU, |
| 24 | const std::string &FS, bool is64Bit) : |
Evan Cheng | 9421470 | 2011-07-01 20:45:01 +0000 | [diff] [blame^] | 25 | SparcGenSubtargetInfo(), |
Chris Lattner | 87c06d6 | 2010-02-04 06:34:01 +0000 | [diff] [blame] | 26 | IsV9(false), |
| 27 | V8DeprecatedInsts(false), |
| 28 | IsVIS(false), |
| 29 | Is64Bit(is64Bit) { |
Chris Lattner | 184cc4a | 2006-01-27 22:38:36 +0000 | [diff] [blame] | 30 | |
Chris Lattner | 0d170a7 | 2006-01-26 06:51:21 +0000 | [diff] [blame] | 31 | // Determine default and user specified characteristics |
Evan Cheng | 276365d | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 32 | std::string CPUName = CPU; |
| 33 | if (CPUName.empty()) { |
| 34 | if (is64Bit) |
| 35 | CPUName = "v9"; |
| 36 | else |
| 37 | CPUName = "v8"; |
Chris Lattner | 87c06d6 | 2010-02-04 06:34:01 +0000 | [diff] [blame] | 38 | } |
Evan Cheng | 276365d | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 39 | IsV9 = CPUName == "v9"; |
Chris Lattner | 0d170a7 | 2006-01-26 06:51:21 +0000 | [diff] [blame] | 40 | |
Chris Lattner | 0d170a7 | 2006-01-26 06:51:21 +0000 | [diff] [blame] | 41 | // Parse features string. |
Evan Cheng | 276365d | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 42 | ParseSubtargetFeatures(FS, CPUName); |
Chris Lattner | d74ea2b | 2006-05-24 17:04:05 +0000 | [diff] [blame] | 43 | } |