LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HexagonSubtarget.h
Go to the documentation of this file.
1 //===-- HexagonSubtarget.h - Define Subtarget for the Hexagon ---*- 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 Hexagon specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef Hexagon_SUBTARGET_H
15 #define Hexagon_SUBTARGET_H
16 
19 #include <string>
20 
21 #define GET_SUBTARGETINFO_HEADER
22 #include "HexagonGenSubtargetInfo.inc"
23 
24 #define Hexagon_SMALL_DATA_THRESHOLD 8
25 #define Hexagon_SLOTS 4
26 
27 namespace llvm {
28 
30  virtual void anchor();
31  bool UseMemOps;
32  bool ModeIEEERndNear;
33 
34 public:
36  V1, V2, V3, V4, V5
37  };
38 
40  std::string CPUString;
42 
43 public:
45 
46  /// getInstrItins - Return the instruction itineraies based on subtarget
47  /// selection.
49 
50 
51  /// ParseSubtargetFeatures - Parses features string setting specified
52  /// subtarget options. Definition of function is auto generated by tblgen.
54 
55  bool hasV2TOps () const { return HexagonArchVersion >= V2; }
56  bool hasV2TOpsOnly () const { return HexagonArchVersion == V2; }
57  bool hasV3TOps () const { return HexagonArchVersion >= V3; }
58  bool hasV3TOpsOnly () const { return HexagonArchVersion == V3; }
59  bool hasV4TOps () const { return HexagonArchVersion >= V4; }
60  bool hasV4TOpsOnly () const { return HexagonArchVersion == V4; }
61  bool useMemOps () const { return HexagonArchVersion >= V4 && UseMemOps; }
62  bool hasV5TOps () const { return HexagonArchVersion >= V5; }
63  bool hasV5TOpsOnly () const { return HexagonArchVersion == V5; }
64  bool modeIEEERndNear () const { return ModeIEEERndNear; }
65 
66  bool isSubtargetV2() const { return HexagonArchVersion == V2;}
67  const std::string &getCPUString () const { return CPUString; }
68 
69  // Threshold for small data section
70  unsigned getSmallDataThreshold() const {
72  }
74  return HexagonArchVersion;
75  }
76 };
77 
78 } // end namespace llvm
79 
80 #endif
InstrItineraryData InstrItins
const HexagonArchEnum & getHexagonArchVersion() const
unsigned getSmallDataThreshold() const
bool hasV3TOpsOnly() const
HexagonArchEnum HexagonArchVersion
#define Hexagon_SMALL_DATA_THRESHOLD
const InstrItineraryData & getInstrItineraryData() const
bool hasV2TOpsOnly() const
bool isSubtargetV2() const
const std::string & getCPUString() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
bool hasV4TOpsOnly() const
bool modeIEEERndNear() const
bool hasV5TOpsOnly() const
HexagonSubtarget(StringRef TT, StringRef CPU, StringRef FS)