LLVM  7.0.0
Nios2Subtarget.h
Go to the documentation of this file.
1 //===-- Nios2Subtarget.h - Define Subtarget for the Nios2 -------*- 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 Nios2 specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_NIOS2_NIOS2SUBTARGET_H
15 #define LLVM_LIB_TARGET_NIOS2_NIOS2SUBTARGET_H
16 
17 #include "Nios2FrameLowering.h"
18 #include "Nios2ISelLowering.h"
19 #include "Nios2InstrInfo.h"
23 
24 #define GET_SUBTARGETINFO_HEADER
25 #include "Nios2GenSubtargetInfo.inc"
26 
27 namespace llvm {
28 class StringRef;
29 
30 class Nios2TargetMachine;
31 
33  virtual void anchor();
34 
35 public:
36  // Nios2 R2 features
37  // Bit manipulation instructions extension
38  bool HasBMX;
39  // Code Density instructions extension
40  bool HasCDX;
41  // Multi-Processor instructions extension
42  bool HasMPX;
43  // New mandatory instructions
45 
46 protected:
48  // Nios2 R1 ISA
50  // Nios2 R2 ISA
52  };
53 
54  // Nios2 architecture version
56 
58 
63 
64 public:
65  /// This constructor initializes the data members to match that
66  /// of the specified triple.
67  Nios2Subtarget(const Triple &TT, const std::string &CPU,
68  const std::string &FS, const TargetMachine &TM);
69 
70  /// ParseSubtargetFeatures - Parses features string setting specified
71  /// subtarget options. Definition of function is auto generated by tblgen.
73 
74  bool hasNios2r1() const { return Nios2ArchVersion >= Nios2r1; }
75  bool isNios2r1() const { return Nios2ArchVersion == Nios2r1; }
76  bool hasNios2r2() const { return Nios2ArchVersion >= Nios2r2; }
77  bool isNios2r2() const { return Nios2ArchVersion == Nios2r2; }
78 
80 
81  const Nios2InstrInfo *getInstrInfo() const override { return &InstrInfo; }
82  const TargetFrameLowering *getFrameLowering() const override {
83  return &FrameLowering;
84  }
85  const Nios2RegisterInfo *getRegisterInfo() const override {
86  return &InstrInfo.getRegisterInfo();
87  }
88  const Nios2TargetLowering *getTargetLowering() const override {
89  return &TLInfo;
90  }
91  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
92  return &TSInfo;
93  }
94 };
95 } // namespace llvm
96 
97 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
Nios2Subtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Nios2InstrInfo InstrInfo
const Nios2RegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Nios2FrameLowering FrameLowering
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool isNios2r1() const
const Nios2TargetLowering * getTargetLowering() const override
const Nios2RegisterInfo * getRegisterInfo() const override
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
SelectionDAGTargetInfo TSInfo
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const Nios2InstrInfo * getInstrInfo() const override
Information about stack frame layout on the target.
const TargetFrameLowering * getFrameLowering() const override
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool hasNios2r2() const
bool hasNios2r1() const
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Nios2Subtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
Nios2TargetLowering TLInfo
bool isNios2r2() const
Nios2ArchEnum Nios2ArchVersion