Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 1 | //=====-- MipsSubtarget.h - Define Subtarget for the Mips -----*- C++ -*--====// |
| 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. |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares the Mips specific subclass of TargetSubtarget. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef MIPSSUBTARGET_H |
| 15 | #define MIPSSUBTARGET_H |
| 16 | |
| 17 | #include "llvm/Target/TargetSubtarget.h" |
| 18 | #include "llvm/Target/TargetMachine.h" |
| 19 | |
| 20 | #include <string> |
| 21 | |
| 22 | namespace llvm { |
| 23 | class Module; |
| 24 | |
| 25 | class MipsSubtarget : public TargetSubtarget { |
Bruno Cardoso Lopes | 13d1b7b | 2007-08-18 01:52:27 +0000 | [diff] [blame] | 26 | |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 27 | protected: |
Bruno Cardoso Lopes | 13d1b7b | 2007-08-18 01:52:27 +0000 | [diff] [blame] | 28 | |
| 29 | bool IsMipsIII; |
Bruno Cardoso Lopes | d2947ee | 2008-06-04 01:45:25 +0000 | [diff] [blame^] | 30 | bool IsLittle; |
Bruno Cardoso Lopes | 13d1b7b | 2007-08-18 01:52:27 +0000 | [diff] [blame] | 31 | InstrItineraryData InstrItins; |
| 32 | |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 33 | public: |
| 34 | /// This constructor initializes the data members to match that |
| 35 | /// of the specified module. |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 36 | MipsSubtarget(const TargetMachine &TM, const Module &M, |
Bruno Cardoso Lopes | d2947ee | 2008-06-04 01:45:25 +0000 | [diff] [blame^] | 37 | const std::string &FS, bool little); |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 38 | |
| 39 | /// ParseSubtargetFeatures - Parses features string setting specified |
| 40 | /// subtarget options. Definition of function is auto generated by tblgen. |
| 41 | void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU); |
| 42 | |
Bruno Cardoso Lopes | 13d1b7b | 2007-08-18 01:52:27 +0000 | [diff] [blame] | 43 | /// isMipsIII - Return true if the selected CPU supports MipsIII ISA |
| 44 | /// support. |
| 45 | bool isMipsIII() const { return IsMipsIII; } |
Bruno Cardoso Lopes | d2947ee | 2008-06-04 01:45:25 +0000 | [diff] [blame^] | 46 | |
| 47 | /// isMipsIII - Return true if the target is little endian. |
| 48 | bool isLittle() const { return IsLittle; } |
Bruno Cardoso Lopes | 972f589 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 49 | }; |
| 50 | } // End llvm namespace |
| 51 | |
| 52 | #endif |