Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 1 | //===- SparcSubtarget.cpp - SPARC Subtarget Information -------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 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 | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame^] | 10 | // This file implements the SPARC specific subclass of TargetSubtargetInfo. |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "SparcSubtarget.h" |
Evan Cheng | 54b68e3 | 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 | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 19 | #include "SparcGenSubtarget.inc" |
Evan Cheng | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 20 | |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 21 | using namespace llvm; |
| 22 | |
Evan Cheng | fe6e405 | 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 | 54b68e3 | 2011-07-01 20:45:01 +0000 | [diff] [blame] | 25 | SparcGenSubtargetInfo(), |
Chris Lattner | 8228b11 | 2010-02-04 06:34:01 +0000 | [diff] [blame] | 26 | IsV9(false), |
| 27 | V8DeprecatedInsts(false), |
| 28 | IsVIS(false), |
| 29 | Is64Bit(is64Bit) { |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 30 | |
| 31 | // Determine default and user specified characteristics |
Evan Cheng | fe6e405 | 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 | 8228b11 | 2010-02-04 06:34:01 +0000 | [diff] [blame] | 38 | } |
Evan Cheng | fe6e405 | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 39 | IsV9 = CPUName == "v9"; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 40 | |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 41 | // Parse features string. |
Evan Cheng | fe6e405 | 2011-06-30 01:53:36 +0000 | [diff] [blame] | 42 | ParseSubtargetFeatures(FS, CPUName); |
Chris Lattner | aa237256 | 2006-05-24 17:04:05 +0000 | [diff] [blame] | 43 | } |