LLVM  14.0.0git
CSKYSubtarget.h
Go to the documentation of this file.
1 //===-- CSKYSubtarget.h - Define Subtarget for the CSKY----------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the CSKY specific subclass of TargetSubtargetInfo.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_CSKY_CSKYSUBTARGET_H
14 #define LLVM_LIB_TARGET_CSKY_CSKYSUBTARGET_H
15 
16 #include "CSKYFrameLowering.h"
17 #include "CSKYISelLowering.h"
18 #include "CSKYInstrInfo.h"
19 #include "CSKYRegisterInfo.h"
23 
24 #define GET_SUBTARGETINFO_HEADER
25 #include "CSKYGenSubtargetInfo.inc"
26 
27 namespace llvm {
28 class StringRef;
29 
31  virtual void anchor();
32 
33  CSKYFrameLowering FrameLowering;
34  CSKYInstrInfo InstrInfo;
36  CSKYTargetLowering TLInfo;
38 
39  bool UseHardFloat;
40  bool UseHardFloatABI;
41  bool HasFPUv2SingleFloat;
42  bool HasFPUv2DoubleFloat;
43  bool HasFPUv3SingleFloat;
44  bool HasFPUv3DoubleFloat;
45 
46  bool HasBTST16;
47  bool HasJAVA;
48  bool HasExtendLrw;
49  bool HasDoloop;
50  bool HasHighRegisters;
51 
52  bool HasE1;
53  bool HasE2;
54  bool Has2E3;
55  bool HasMP;
56  bool Has3E3r1;
57  bool Has3r1E3r2;
58  bool Has3r2E3r3;
59  bool Has3E7;
60  bool HasMP1E2;
61  bool Has7E10;
62  bool Has10E60;
63 
64 public:
65  CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU,
66  StringRef FS, const TargetMachine &TM);
67 
68  const CSKYFrameLowering *getFrameLowering() const override {
69  return &FrameLowering;
70  }
71  const CSKYInstrInfo *getInstrInfo() const override { return &InstrInfo; }
72  const CSKYRegisterInfo *getRegisterInfo() const override { return &RegInfo; }
73  const CSKYTargetLowering *getTargetLowering() const override {
74  return &TLInfo;
75  }
76  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
77  return &TSInfo;
78  }
79 
80  /// Initializes using the passed in CPU and feature strings so that we can
81  /// use initializer lists for subtarget initialization.
83  StringRef CPU,
84  StringRef TuneCPU,
85  StringRef FS);
86 
87  // Generated by inc file
89 
90  bool useHardFloatABI() const;
91  bool useHardFloat() const { return UseHardFloat; }
92  bool hasFPUv2SingleFloat() const { return HasFPUv2SingleFloat; }
93  bool hasFPUv2DoubleFloat() const { return HasFPUv2DoubleFloat; }
94  bool hasFPUv2() const { return HasFPUv2SingleFloat || HasFPUv2DoubleFloat; }
95  bool hasFPUv3SingleFloat() const { return HasFPUv3SingleFloat; }
96  bool hasFPUv3DoubleFloat() const { return HasFPUv3DoubleFloat; }
97  bool hasFPUv3() const { return HasFPUv3SingleFloat || HasFPUv3DoubleFloat; }
98  bool hasAnyFloatExt() const { return hasFPUv2() || hasFPUv3(); };
99 
100  bool hasBTST16() const { return HasBTST16; }
101  bool hasJAVA() const { return HasJAVA; }
102  bool hasExtendLrw() const { return HasExtendLrw; }
103  bool hasDoloop() const { return HasDoloop; }
104  bool hasHighRegisters() const { return HasHighRegisters; }
105 
106  bool hasE1() const { return HasE1; }
107  bool hasE2() const { return HasE2; }
108  bool has2E3() const { return Has2E3; }
109  bool has3r1E3r2() const { return Has3r1E3r2; }
110  bool has3r2E3r3() const { return Has3r2E3r3; }
111  bool has3E3r1() const { return Has3E3r1; }
112  bool has3E7() const { return Has3E7; }
113  bool hasMP() const { return HasMP; }
114  bool hasMP1E2() const { return HasMP1E2; }
115  bool has7E10() const { return Has7E10; }
116  bool has10E60() const { return Has10E60; }
117 };
118 } // namespace llvm
119 
120 #endif // LLVM_LIB_TARGET_CSKY_CSKYSUBTARGET_H
llvm::CSKYFrameLowering
Definition: CSKYFrameLowering.h:21
llvm::CSKYSubtarget::hasMP
bool hasMP() const
Definition: CSKYSubtarget.h:113
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::CSKYSubtarget::has7E10
bool has7E10() const
Definition: CSKYSubtarget.h:115
CSKYRegisterInfo.h
llvm::CSKYSubtarget::hasJAVA
bool hasJAVA() const
Definition: CSKYSubtarget.h:101
llvm::CSKYSubtarget::has3E7
bool has3E7() const
Definition: CSKYSubtarget.h:112
llvm::CSKYInstrInfo
Definition: CSKYInstrInfo.h:26
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::CSKYSubtarget::hasDoloop
bool hasDoloop() const
Definition: CSKYSubtarget.h:103
llvm::CSKYRegisterInfo
Definition: CSKYRegisterInfo.h:24
llvm::CSKYSubtarget::CSKYSubtarget
CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, const TargetMachine &TM)
Definition: CSKYSubtarget.cpp:61
llvm::CSKYSubtarget::getTargetLowering
const CSKYTargetLowering * getTargetLowering() const override
Definition: CSKYSubtarget.h:73
llvm::CSKYSubtarget::has3r1E3r2
bool has3r1E3r2() const
Definition: CSKYSubtarget.h:109
TargetMachine.h
llvm::CSKYSubtarget::hasFPUv2SingleFloat
bool hasFPUv2SingleFloat() const
Definition: CSKYSubtarget.h:92
llvm::CSKYSubtarget::hasMP1E2
bool hasMP1E2() const
Definition: CSKYSubtarget.h:114
CSKYInstrInfo.h
llvm::SelectionDAGTargetInfo
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Definition: SelectionDAGTargetInfo.h:31
llvm::CSKYSubtarget::getRegisterInfo
const CSKYRegisterInfo * getRegisterInfo() const override
Definition: CSKYSubtarget.h:72
llvm::CSKYSubtarget::getSelectionDAGInfo
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: CSKYSubtarget.h:76
llvm::CSKYSubtarget
Definition: CSKYSubtarget.h:30
llvm::CSKYSubtarget::hasBTST16
bool hasBTST16() const
Definition: CSKYSubtarget.h:100
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::CSKYSubtarget::getInstrInfo
const CSKYInstrInfo * getInstrInfo() const override
Definition: CSKYSubtarget.h:71
llvm::CSKYSubtarget::useHardFloat
bool useHardFloat() const
Definition: CSKYSubtarget.h:91
llvm::CSKYSubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
llvm::CSKYSubtarget::has3E3r1
bool has3E3r1() const
Definition: CSKYSubtarget.h:111
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:80
CSKYFrameLowering.h
llvm::CSKYSubtarget::initializeSubtargetDependencies
CSKYSubtarget & initializeSubtargetDependencies(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS)
Initializes using the passed in CPU and feature strings so that we can use initializer lists for subt...
Definition: CSKYSubtarget.cpp:24
llvm::CSKYSubtarget::useHardFloatABI
bool useHardFloatABI() const
Definition: CSKYSubtarget.cpp:67
llvm::CSKYSubtarget::hasAnyFloatExt
bool hasAnyFloatExt() const
Definition: CSKYSubtarget.h:98
RegInfo
Definition: AMDGPUAsmParser.cpp:2388
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
CSKYGenSubtargetInfo
TargetSubtargetInfo.h
CSKYISelLowering.h
llvm::CSKYSubtarget::hasFPUv3
bool hasFPUv3() const
Definition: CSKYSubtarget.h:97
llvm::CSKYSubtarget::hasFPUv3SingleFloat
bool hasFPUv3SingleFloat() const
Definition: CSKYSubtarget.h:95
llvm::CSKYSubtarget::hasFPUv2DoubleFloat
bool hasFPUv2DoubleFloat() const
Definition: CSKYSubtarget.h:93
llvm::CSKYSubtarget::hasFPUv3DoubleFloat
bool hasFPUv3DoubleFloat() const
Definition: CSKYSubtarget.h:96
SelectionDAGTargetInfo.h
llvm::CSKYSubtarget::hasE2
bool hasE2() const
Definition: CSKYSubtarget.h:107
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::CSKYSubtarget::has2E3
bool has2E3() const
Definition: CSKYSubtarget.h:108
llvm::CSKYSubtarget::hasFPUv2
bool hasFPUv2() const
Definition: CSKYSubtarget.h:94
llvm::CSKYSubtarget::hasE1
bool hasE1() const
Definition: CSKYSubtarget.h:106
llvm::CSKYSubtarget::has10E60
bool has10E60() const
Definition: CSKYSubtarget.h:116
llvm::CSKYSubtarget::hasHighRegisters
bool hasHighRegisters() const
Definition: CSKYSubtarget.h:104
llvm::CSKYSubtarget::has3r2E3r3
bool has3r2E3r3() const
Definition: CSKYSubtarget.h:110
llvm::CSKYSubtarget::hasExtendLrw
bool hasExtendLrw() const
Definition: CSKYSubtarget.h:102
llvm::CSKYSubtarget::getFrameLowering
const CSKYFrameLowering * getFrameLowering() const override
Definition: CSKYSubtarget.h:68
llvm::CSKYTargetLowering
Definition: CSKYISelLowering.h:42