LLVM: lib/Target/AVR/AVRSubtarget.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_AVR_SUBTARGET_H
14#define LLVM_AVR_SUBTARGET_H
15
19
25
26#define GET_SUBTARGETINFO_HEADER
27#include "AVRGenSubtargetInfo.inc"
28
29namespace llvm {
30
31
33public:
34
35
36
37
38
39 AVRSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
41
44 return &FrameLowering;
45 }
53 return &InstrInfo.getRegisterInfo();
54 }
55
56
57
59
62
63
64#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
65 bool GETTER() const { return ATTRIBUTE; }
66#include "AVRGenSubtargetInfo.inc"
67
69
71
72
73
75 assert(ELFArch != 0 &&
76 "every device must have an associate ELF architecture");
77 return ELFArch;
78 }
79
80
81 int getIORegRAMPZ() const { return hasELPM() ? 0x3b : -1; }
82 int getIORegEIND() const { return hasEIJMPCALL() ? 0x3c : -1; }
84 int getIORegSPH() const { return hasSmallStack() ? -1 : 0x3e; }
86
87
88 int getRegTmpIndex() const { return hasTinyEncoding() ? 16 : 0; }
89 int getRegZeroIndex() const { return hasTinyEncoding() ? 17 : 1; }
90
92 return hasTinyEncoding() ? AVR::R16 : AVR::R0;
93 }
95 return hasTinyEncoding() ? AVR::R17 : AVR::R1;
96 }
97
98private:
99
100 unsigned ELFArch = 0;
101
102
103#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
104 bool ATTRIBUTE = DEFAULT;
105#include "AVRGenSubtargetInfo.inc"
106
111};
112
113}
114
115#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Utilities for creating function call frames.
Utilities related to the AVR instruction set.
Utilities relating to AVR registers.
Holds information about the AVR instruction selection DAG.
Register getTmpRegister() const
Definition AVRSubtarget.h:91
uint8_t getIORegisterOffset() const
Definition AVRSubtarget.h:68
unsigned getELFArch() const
Gets the ELF architecture for the e_flags field of an ELF object file.
Definition AVRSubtarget.h:74
const TargetFrameLowering * getFrameLowering() const override
Definition AVRSubtarget.h:43
int getIORegRAMPZ() const
Get I/O register addresses.
Definition AVRSubtarget.h:81
Register getZeroRegister() const
Definition AVRSubtarget.h:94
int getIORegSPL() const
Definition AVRSubtarget.h:83
int getRegTmpIndex() const
Get GPR aliases.
Definition AVRSubtarget.h:88
const AVRInstrInfo * getInstrInfo() const override
Definition AVRSubtarget.h:42
int getIORegSREG() const
Definition AVRSubtarget.h:85
int getIORegEIND() const
Definition AVRSubtarget.h:82
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
Parses a subtarget feature string, setting appropriate options.
const AVRSelectionDAGInfo * getSelectionDAGInfo() const override
Definition AVRSubtarget.h:49
bool enableSubRegLiveness() const override
Definition AVRSubtarget.h:70
int getRegZeroIndex() const
Definition AVRSubtarget.h:89
const AVRTargetLowering * getTargetLowering() const override
Definition AVRSubtarget.h:46
AVRSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const AVRTargetMachine &TM)
Creates an AVR subtarget.
AVRSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS, const TargetMachine &TM)
int getIORegSPH() const
Definition AVRSubtarget.h:84
const AVRRegisterInfo * getRegisterInfo() const override
Definition AVRSubtarget.h:52
Performs target lowering for the AVR.
A generic AVR implementation.
Wrapper class representing virtual and physical registers.
StringRef - Represent a constant reference to a string, i.e.
Information about stack frame layout on the target.
Primary interface to the complete machine description for the target machine.
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.