blob: 4efb58d097b156ddaeaedcd2336a0422dde271f0 [file] [log] [blame]
Ulrich Weigand5f613df2013-05-06 16:15:19 +00001//===-- 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
24namespace llvm {
25class GlobalValue;
26class StringRef;
27
28class SystemZSubtarget : public SystemZGenSubtargetInfo {
Richard Sandiford27d1cfe2013-07-19 16:09:03 +000029protected:
30 bool HasDistinctOps;
Richard Sandiforda68e6f52013-07-25 08:57:02 +000031 bool HasLoadStoreOnCond;
Richard Sandiford6cf80b32013-07-31 11:17:35 +000032 bool HasHighWord;
Richard Sandiford27d1cfe2013-07-19 16:09:03 +000033
Ulrich Weigand5f613df2013-05-06 16:15:19 +000034private:
35 Triple TargetTriple;
36
37public:
38 SystemZSubtarget(const std::string &TT, const std::string &CPU,
39 const std::string &FS);
40
41 // Automatically generated by tblgen.
42 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
43
Richard Sandiford27d1cfe2013-07-19 16:09:03 +000044 // Return true if the target has the distinct-operands facility.
45 bool hasDistinctOps() const { return HasDistinctOps; }
46
Richard Sandiforda68e6f52013-07-25 08:57:02 +000047 // Return true if the target has the load/store-on-condition facility.
48 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
49
Richard Sandiford6cf80b32013-07-31 11:17:35 +000050 // Return true if the target has the high-word facility.
51 bool hasHighWord() const { return HasHighWord; }
52
Ulrich Weigand5f613df2013-05-06 16:15:19 +000053 // Return true if GV can be accessed using LARL for reloc model RM
54 // and code model CM.
55 bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM,
56 CodeModel::Model CM) const;
57
58 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
59};
60} // end namespace llvm
61
62#endif