1251607Sdim//===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===//
2251607Sdim//
3251607Sdim//                     The LLVM Compiler Infrastructure
4251607Sdim//
5251607Sdim// This file is distributed under the University of Illinois Open Source
6251607Sdim// License. See LICENSE.TXT for details.
7251607Sdim//
8251607Sdim//===----------------------------------------------------------------------===//
9251607Sdim//
10251607Sdim// This file declares the SystemZ specific subclass of TargetSubtargetInfo.
11251607Sdim//
12251607Sdim//===----------------------------------------------------------------------===//
13251607Sdim
14251607Sdim#ifndef SYSTEMZSUBTARGET_H
15251607Sdim#define SYSTEMZSUBTARGET_H
16251607Sdim
17251607Sdim#include "llvm/ADT/Triple.h"
18251607Sdim#include "llvm/Target/TargetSubtargetInfo.h"
19251607Sdim#include <string>
20251607Sdim
21251607Sdim#define GET_SUBTARGETINFO_HEADER
22251607Sdim#include "SystemZGenSubtargetInfo.inc"
23251607Sdim
24251607Sdimnamespace llvm {
25251607Sdimclass GlobalValue;
26251607Sdimclass StringRef;
27251607Sdim
28251607Sdimclass SystemZSubtarget : public SystemZGenSubtargetInfo {
29263509Sdim  virtual void anchor();
30263509Sdimprotected:
31263509Sdim  bool HasDistinctOps;
32263509Sdim  bool HasLoadStoreOnCond;
33263509Sdim  bool HasHighWord;
34263509Sdim  bool HasFPExtension;
35263509Sdim
36251607Sdimprivate:
37251607Sdim  Triple TargetTriple;
38251607Sdim
39251607Sdimpublic:
40251607Sdim  SystemZSubtarget(const std::string &TT, const std::string &CPU,
41251607Sdim                   const std::string &FS);
42251607Sdim
43263509Sdim  // This is important for reducing register pressure in vector code.
44263509Sdim  virtual bool useAA() const LLVM_OVERRIDE { return true; }
45263509Sdim
46251607Sdim  // Automatically generated by tblgen.
47251607Sdim  void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
48251607Sdim
49263509Sdim  // Return true if the target has the distinct-operands facility.
50263509Sdim  bool hasDistinctOps() const { return HasDistinctOps; }
51263509Sdim
52263509Sdim  // Return true if the target has the load/store-on-condition facility.
53263509Sdim  bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
54263509Sdim
55263509Sdim  // Return true if the target has the high-word facility.
56263509Sdim  bool hasHighWord() const { return HasHighWord; }
57263509Sdim
58263509Sdim  // Return true if the target has the floating-point extension facility.
59263509Sdim  bool hasFPExtension() const { return HasFPExtension; }
60263509Sdim
61251607Sdim  // Return true if GV can be accessed using LARL for reloc model RM
62251607Sdim  // and code model CM.
63251607Sdim  bool isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM,
64251607Sdim                       CodeModel::Model CM) const;
65251607Sdim
66251607Sdim  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
67251607Sdim};
68251607Sdim} // end namespace llvm
69251607Sdim
70251607Sdim#endif
71