20const struct ModifierEntry {
21 const char *
const Spelling;
39 return new (Ctx)
AVRMCExpr(Kind, Expr, Negated);
62 if (
Value.isAbsolute()) {
63 Result = evaluateAsInt64(
Value.getConstant());
79 if (
Value.isAbsolute()) {
82 if (!Asm || !Asm->hasLayout())
101int64_t AVRMCExpr::evaluateAsInt64(int64_t
Value)
const {
145 return static_cast<uint64_t>(Value) & 0xff;
197 const auto &Modifier =
199 return Mod.VariantKind == Kind;
202 if (Modifier != std::end(ModifierNames)) {
203 return Modifier->Spelling;
209 const auto &Modifier =
214 if (Modifier != std::end(ModifierNames)) {
215 return Modifier->VariantKind;
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A expression in AVR machine code.
static const AVRMCExpr * create(VariantKind Kind, const MCExpr *Expr, bool isNegated, MCContext &Ctx)
Creates an AVR machine code expression.
void visitUsedExpr(MCStreamer &streamer) const override
static VariantKind getKindByName(StringRef Name)
AVR::Fixups getFixupKind() const
Gets the fixup which corresponds to the expression.
bool evaluateAsConstant(int64_t &Result) const
Evaluates the fixup as a constant value.
void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override
VariantKind getKind() const
Gets the type of the expression.
const MCExpr * getSubExpr() const
VariantKind
Specifies the type of an expression.
@ VK_AVR_PM_LO8
Corresponds to pm_lo8().
@ VK_AVR_LO8
Corresponds to lo8().
@ VK_AVR_PM_HI8
Corresponds to pm_hi8().
@ VK_AVR_PM
Corresponds to pm(), reference to program memory.
@ VK_AVR_HHI8
Corresponds to hhi8().
@ VK_AVR_HI8_GS
Corresponds to hi8(gs()).
@ VK_AVR_HH8
Corresponds to hlo8() and hh8().
@ VK_AVR_LO8_GS
Corresponds to lo8(gs()).
@ VK_AVR_PM_HH8
Corresponds to pm_hh8().
@ VK_AVR_GS
Corresponds to gs().
@ VK_AVR_HI8
Corresponds to hi8().
const char * getName() const
Gets the name of the expression.
bool evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup) const override
This class is intended to be used as a base class for asm properties and features specific to the tar...
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
bool evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Streaming machine code generation interface.
void visitUsedExpr(const MCExpr &Expr)
Represent a reference to a symbol from inside an expression.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This represents an "assembler immediate".
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Fixups
The set of supported fixups.
@ fixup_16_pm
A 16-bit program memory address.
@ fixup_hh8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 24-bit value ...
@ fixup_ms8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 32-bi...
@ fixup_lo8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a negated 16-bi...
@ fixup_ms8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 32-bit value ...
@ fixup_lo8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a 16-bit value ...
@ fixup_hi8_ldi_pm_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 16-bi...
@ fixup_hi8_ldi
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 16-bit value ...
@ fixup_lo8_ldi_pm
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a 16-bit progra...
@ fixup_hh8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 24-bi...
@ fixup_hh8_ldi_pm
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 24-bit progra...
@ fixup_lo8_ldi_pm_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the lower 8 bits of a negated 16-bi...
@ fixup_hi8_ldi_pm
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a 16-bit progra...
@ fixup_hh8_ldi_pm_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 24-bi...
@ fixup_hi8_ldi_neg
Replaces the immediate operand of a 16-bit Rd, K instruction with the upper 8 bits of a negated 16-bi...
This is an optimization pass for GlobalISel generic memory operations.
@ Mod
The access may modify the value stored in memory.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.