LLVM 22.0.0git
XtensaSubtarget.h
Go to the documentation of this file.
1//===-- XtensaSubtarget.h - Define Subtarget for the Xtensa ----*- 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 Xtensa specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_XTENSA_XTENSASUBTARGET_H
14#define LLVM_LIB_TARGET_XTENSA_XTENSASUBTARGET_H
15
16#include "XtensaFrameLowering.h"
17#include "XtensaISelLowering.h"
18#include "XtensaInstrInfo.h"
19#include "XtensaRegisterInfo.h"
22#include "llvm/IR/DataLayout.h"
24
25#define GET_SUBTARGETINFO_HEADER
26#include "XtensaGenSubtargetInfo.inc"
27
28namespace llvm {
29class StringRef;
30
32private:
33// Bool members corresponding to the SubtargetFeatures defined in tablegen
34#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
35 bool ATTRIBUTE = DEFAULT;
36#include "XtensaGenSubtargetInfo.inc"
37
38 const Triple &TargetTriple;
39 XtensaInstrInfo InstrInfo;
40 XtensaTargetLowering TLInfo;
41 SelectionDAGTargetInfo TSInfo;
42 XtensaFrameLowering FrameLowering;
43
44 XtensaSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
45
46public:
47 XtensaSubtarget(const Triple &TT, StringRef CPU, StringRef FS,
48 const TargetMachine &TM);
49
50 const Triple &getTargetTriple() const { return TargetTriple; }
51
52 const TargetFrameLowering *getFrameLowering() const override {
53 return &FrameLowering;
54 }
55 const XtensaInstrInfo *getInstrInfo() const override { return &InstrInfo; }
56 const XtensaRegisterInfo *getRegisterInfo() const override {
57 return &InstrInfo.getRegisterInfo();
58 }
59
60 const XtensaTargetLowering *getTargetLowering() const override {
61 return &TLInfo;
62 }
64 return &TSInfo;
65 }
66
67 bool hasDensity() const { return HasDensity; }
68 bool hasMAC16() const { return HasMAC16; }
69 bool hasWindowed() const { return HasWindowed; }
70 bool hasBoolean() const { return HasBoolean; }
71 bool hasLoop() const { return HasLoop; }
72 bool hasSEXT() const { return HasSEXT; }
73 bool hasCLAMPS() const { return HasCLAMPS; }
74 bool hasNSA() const { return HasNSA; }
75 bool hasMINMAX() const { return HasMINMAX; }
76 bool hasMul16() const { return HasMul16; }
77 bool hasMul32() const { return HasMul32; }
78 bool hasMul32High() const { return HasMul32High; }
79 bool hasDiv32() const { return HasDiv32; }
80 bool hasS32C1I() const { return HasS32C1I; }
81 bool hasForcedAtomics() const { return HasForcedAtomics; }
82 bool hasSingleFloat() const { return HasSingleFloat; }
83 bool hasRegionProtection() const { return HasRegionProtection; }
84 bool hasRelocatableVector() const { return HasRelocatableVector; }
85 bool hasMiscSR() const { return HasMiscSR; }
86 bool hasExtendedL32R() const { return HasExtendedL32R; }
87 bool hasDataCache() const { return HasDataCache; }
88 bool hasHighPriInterrupts() const { return HasHighPriInterrupts; }
89 bool hasHighPriInterruptsLevel3() const { return HasHighPriInterruptsLevel3; }
90 bool hasHighPriInterruptsLevel4() const { return HasHighPriInterruptsLevel4; }
91 bool hasHighPriInterruptsLevel5() const { return HasHighPriInterruptsLevel5; }
92 bool hasHighPriInterruptsLevel6() const { return HasHighPriInterruptsLevel6; }
93 bool hasHighPriInterruptsLevel7() const { return HasHighPriInterruptsLevel7; }
94 bool hasInterrupt() const { return HasInterrupt; }
95 bool hasException() const { return HasException; }
96 bool hasTHREADPTR() const { return HasTHREADPTR; }
97 bool isWindowedABI() const { return hasWindowed(); }
98
99 // Automatically generated by tblgen.
101};
102} // end namespace llvm
103
104#endif /* LLVM_LIB_TARGET_XTENSA_XTENSASUBTARGET_H */
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
Information about stack frame layout on the target.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:47
bool hasException() const
const Triple & getTargetTriple() const
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
const XtensaInstrInfo * getInstrInfo() const override
bool hasHighPriInterruptsLevel6() const
bool isWindowedABI() const
bool hasInterrupt() const
bool hasTHREADPTR() const
bool hasHighPriInterruptsLevel7() const
bool hasDataCache() const
bool hasHighPriInterrupts() const
bool hasForcedAtomics() const
bool hasHighPriInterruptsLevel3() const
bool hasHighPriInterruptsLevel5() const
bool hasHighPriInterruptsLevel4() const
bool hasWindowed() const
const XtensaRegisterInfo * getRegisterInfo() const override
bool hasSingleFloat() const
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
bool hasExtendedL32R() const
bool hasMul32High() const
bool hasRelocatableVector() const
const XtensaTargetLowering * getTargetLowering() const override
bool hasRegionProtection() const
const TargetFrameLowering * getFrameLowering() const override
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18