blob: f7c8f96c044954c2f9ea3aaf63fda6d185177c54 [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 {
Juergen Ributzkad12ccbd2013-11-19 00:57:56 +000029 virtual void anchor();
Richard Sandiford27d1cfe2013-07-19 16:09:03 +000030protected:
31 bool HasDistinctOps;
Richard Sandiforda68e6f52013-07-25 08:57:02 +000032 bool HasLoadStoreOnCond;
Richard Sandiford6cf80b32013-07-31 11:17:35 +000033 bool HasHighWord;
Richard Sandiford8e92c382013-08-21 08:58:08 +000034 bool HasFPExtension;
Richard Sandiford9afe6132013-12-10 10:36:34 +000035 bool HasFastSerialization;
Richard Sandiford45645a22013-12-24 15:14:05 +000036 bool HasInterlockedAccess1;
Richard Sandiford27d1cfe2013-07-19 16:09:03 +000037
Ulrich Weigand5f613df2013-05-06 16:15:19 +000038private:
39 Triple TargetTriple;
40
41public:
42 SystemZSubtarget(const std::string &TT, const std::string &CPU,
43 const std::string &FS);
44
Richard Sandiford094e6092013-10-28 13:53:37 +000045 // This is important for reducing register pressure in vector code.
46 virtual bool useAA() const LLVM_OVERRIDE { return true; }
47
Ulrich Weigand5f613df2013-05-06 16:15:19 +000048 // Automatically generated by tblgen.
49 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
50
Richard Sandiford27d1cfe2013-07-19 16:09:03 +000051 // Return true if the target has the distinct-operands facility.
52 bool hasDistinctOps() const { return HasDistinctOps; }
53
Richard Sandiforda68e6f52013-07-25 08:57:02 +000054 // Return true if the target has the load/store-on-condition facility.
55 bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
56
Richard Sandiford6cf80b32013-07-31 11:17:35 +000057 // Return true if the target has the high-word facility.
58 bool hasHighWord() const { return HasHighWord; }
59
Richard Sandiford8e92c382013-08-21 08:58:08 +000060 // Return true if the target has the floating-point extension facility.
61 bool hasFPExtension() const { return HasFPExtension; }
62
Richard Sandiford9afe6132013-12-10 10:36:34 +000063 // Return true if the target has the fast-serialization facility.
64 bool hasFastSerialization() const { return HasFastSerialization; }
65
Richard Sandiford45645a22013-12-24 15:14:05 +000066 // Return true if the target has interlocked-access facility 1.
67 bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
68
Ulrich Weigand5f613df2013-05-06 16:15:19 +000069 // Return true if GV can be accessed using LARL for reloc model RM
70 // and code model CM.
71 bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM,
72 CodeModel::Model CM) const;
73
74 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
75};
76} // end namespace llvm
77
78#endif