Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 1 | //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares the SystemZ specific subclass of TargetSubtargetInfo. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef SYSTEMZSUBTARGET_H |
| 15 | #define SYSTEMZSUBTARGET_H |
| 16 | |
| 17 | #include "llvm/ADT/Triple.h" |
| 18 | #include "llvm/Target/TargetSubtargetInfo.h" |
| 19 | #include <string> |
| 20 | |
| 21 | #define GET_SUBTARGETINFO_HEADER |
| 22 | #include "SystemZGenSubtargetInfo.inc" |
| 23 | |
| 24 | namespace llvm { |
| 25 | class GlobalValue; |
| 26 | class StringRef; |
| 27 | |
| 28 | class SystemZSubtarget : public SystemZGenSubtargetInfo { |
Juergen Ributzka | d12ccbd | 2013-11-19 00:57:56 +0000 | [diff] [blame] | 29 | virtual void anchor(); |
Richard Sandiford | 27d1cfe | 2013-07-19 16:09:03 +0000 | [diff] [blame] | 30 | protected: |
| 31 | bool HasDistinctOps; |
Richard Sandiford | a68e6f5 | 2013-07-25 08:57:02 +0000 | [diff] [blame] | 32 | bool HasLoadStoreOnCond; |
Richard Sandiford | 6cf80b3 | 2013-07-31 11:17:35 +0000 | [diff] [blame] | 33 | bool HasHighWord; |
Richard Sandiford | 8e92c38 | 2013-08-21 08:58:08 +0000 | [diff] [blame] | 34 | bool HasFPExtension; |
Richard Sandiford | 9afe613 | 2013-12-10 10:36:34 +0000 | [diff] [blame^] | 35 | bool HasFastSerialization; |
Richard Sandiford | 27d1cfe | 2013-07-19 16:09:03 +0000 | [diff] [blame] | 36 | |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 37 | private: |
| 38 | Triple TargetTriple; |
| 39 | |
| 40 | public: |
| 41 | SystemZSubtarget(const std::string &TT, const std::string &CPU, |
| 42 | const std::string &FS); |
| 43 | |
Richard Sandiford | 094e609 | 2013-10-28 13:53:37 +0000 | [diff] [blame] | 44 | // This is important for reducing register pressure in vector code. |
| 45 | virtual bool useAA() const LLVM_OVERRIDE { return true; } |
| 46 | |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 47 | // Automatically generated by tblgen. |
| 48 | void ParseSubtargetFeatures(StringRef CPU, StringRef FS); |
| 49 | |
Richard Sandiford | 27d1cfe | 2013-07-19 16:09:03 +0000 | [diff] [blame] | 50 | // Return true if the target has the distinct-operands facility. |
| 51 | bool hasDistinctOps() const { return HasDistinctOps; } |
| 52 | |
Richard Sandiford | a68e6f5 | 2013-07-25 08:57:02 +0000 | [diff] [blame] | 53 | // Return true if the target has the load/store-on-condition facility. |
| 54 | bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; } |
| 55 | |
Richard Sandiford | 6cf80b3 | 2013-07-31 11:17:35 +0000 | [diff] [blame] | 56 | // Return true if the target has the high-word facility. |
| 57 | bool hasHighWord() const { return HasHighWord; } |
| 58 | |
Richard Sandiford | 8e92c38 | 2013-08-21 08:58:08 +0000 | [diff] [blame] | 59 | // Return true if the target has the floating-point extension facility. |
| 60 | bool hasFPExtension() const { return HasFPExtension; } |
| 61 | |
Richard Sandiford | 9afe613 | 2013-12-10 10:36:34 +0000 | [diff] [blame^] | 62 | // Return true if the target has the fast-serialization facility. |
| 63 | bool hasFastSerialization() const { return HasFastSerialization; } |
| 64 | |
Ulrich Weigand | 5f613df | 2013-05-06 16:15:19 +0000 | [diff] [blame] | 65 | // Return true if GV can be accessed using LARL for reloc model RM |
| 66 | // and code model CM. |
| 67 | bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM, |
| 68 | CodeModel::Model CM) const; |
| 69 | |
| 70 | bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } |
| 71 | }; |
| 72 | } // end namespace llvm |
| 73 | |
| 74 | #endif |