LLVM 20.0.0git
Namespaces | Functions
adjust Namespace Reference

Namespaces

namespace  ldi
 Fixups relating to the LDI instruction.
 

Functions

static void signed_width (unsigned Width, uint64_t Value, std::string Description, const MCFixup &Fixup, MCContext *Ctx=nullptr)
 
static void unsigned_width (unsigned Width, uint64_t Value, std::string Description, const MCFixup &Fixup, MCContext *Ctx=nullptr)
 
static void adjustBranch (unsigned Size, const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 Adjusts the value of a branch target before fixup application.
 
static void adjustRelativeBranch (unsigned Size, const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 Adjusts the value of a relative branch target before fixup application.
 
static void fixup_call (unsigned Size, const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 22-bit absolute fixup.
 
static void fixup_7_pcrel (unsigned Size, const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 7-bit PC-relative fixup.
 
static void fixup_13_pcrel (unsigned Size, const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 12-bit PC-relative fixup.
 
static void fixup_6 (const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 6-bit fixup for the immediate operand of the STD/LDD family of instructions.
 
static void fixup_6_adiw (const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 6-bit fixup for the immediate operand of the ADIW family of instructions.
 
static void fixup_port5 (const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 5-bit port number fixup on the SBIC family of instructions.
 
static void fixup_port6 (const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 6-bit port number fixup on the IN family of instructions.
 
static void fixup_lds_sts_16 (const MCFixup &Fixup, uint64_t &Value, MCContext *Ctx=nullptr)
 7-bit data space address fixup for the LDS/STS instructions on AVRTiny.
 
static void pm (uint64_t &Value)
 Adjusts a program memory address.
 

Function Documentation

◆ adjustBranch()

static void adjust::adjustBranch ( unsigned  Size,
const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

Adjusts the value of a branch target before fixup application.

Definition at line 78 of file AVRAsmBackend.cpp.

References llvm::AVR::fixups::adjustBranchTarget(), Fixup, Size, and unsigned_width().

Referenced by fixup_call().

◆ adjustRelativeBranch()

static void adjust::adjustRelativeBranch ( unsigned  Size,
const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

Adjusts the value of a relative branch target before fixup application.

Definition at line 89 of file AVRAsmBackend.cpp.

References llvm::AVR::fixups::adjustBranchTarget(), Fixup, signed_width(), and Size.

Referenced by fixup_13_pcrel(), and fixup_7_pcrel().

◆ fixup_13_pcrel()

static void adjust::fixup_13_pcrel ( unsigned  Size,
const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

12-bit PC-relative fixup.

Yes, the fixup is 12 bits even though the name says otherwise.

Resolves to: 0000 kkkk kkkk kkkk Offset of 0 (so the result isn't left-shifted before application).

Definition at line 135 of file AVRAsmBackend.cpp.

References adjustRelativeBranch(), Fixup, and Size.

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_6()

static void adjust::fixup_6 ( const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

6-bit fixup for the immediate operand of the STD/LDD family of instructions.

Resolves to: 10q0 qq10 0000 1qqq

Definition at line 148 of file AVRAsmBackend.cpp.

References Fixup, and unsigned_width().

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_6_adiw()

static void adjust::fixup_6_adiw ( const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

6-bit fixup for the immediate operand of the ADIW family of instructions.

Resolves to: 0000 0000 kk00 kkkk

Definition at line 160 of file AVRAsmBackend.cpp.

References Fixup, and unsigned_width().

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_7_pcrel()

static void adjust::fixup_7_pcrel ( unsigned  Size,
const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

7-bit PC-relative fixup.

Resolves to: 0000 00kk kkkk k000 Offset of 0 (so the result is left shifted by 3 bits before application).

Definition at line 121 of file AVRAsmBackend.cpp.

References adjustRelativeBranch(), Fixup, and Size.

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_call()

static void adjust::fixup_call ( unsigned  Size,
const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

22-bit absolute fixup.

Resolves to: 1001 kkkk 010k kkkk kkkk kkkk 111k kkkk

Offset of 0 (so the result is left shifted by 3 bits before application).

Definition at line 105 of file AVRAsmBackend.cpp.

References adjustBranch(), Fixup, and Size.

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_lds_sts_16()

static void adjust::fixup_lds_sts_16 ( const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

7-bit data space address fixup for the LDS/STS instructions on AVRTiny.

Resolves to: 1010 ikkk dddd kkkk

Definition at line 195 of file AVRAsmBackend.cpp.

References Fixup, and unsigned_width().

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_port5()

static void adjust::fixup_port5 ( const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

5-bit port number fixup on the SBIC family of instructions.

Resolves to: 0000 0000 AAAA A000

Definition at line 171 of file AVRAsmBackend.cpp.

References Fixup, and unsigned_width().

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ fixup_port6()

static void adjust::fixup_port6 ( const MCFixup Fixup,
uint64_t Value,
MCContext Ctx = nullptr 
)
static

6-bit port number fixup on the IN family of instructions.

Resolves to: 1011 0AAd dddd AAAA

Definition at line 184 of file AVRAsmBackend.cpp.

References Fixup, and unsigned_width().

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ pm()

static void adjust::pm ( uint64_t Value)
static

Adjusts a program memory address.

This is a simple right-shift.

Definition at line 203 of file AVRAsmBackend.cpp.

Referenced by llvm::AVRAsmBackend::adjustFixupValue().

◆ signed_width()

static void adjust::signed_width ( unsigned  Width,
uint64_t  Value,
std::string  Description,
const MCFixup Fixup,
MCContext Ctx = nullptr 
)
static

Definition at line 38 of file AVRAsmBackend.cpp.

References Fixup, llvm::isIntN(), llvm_unreachable, llvm::maxIntN(), and llvm::minIntN().

Referenced by adjustRelativeBranch().

◆ unsigned_width()

static void adjust::unsigned_width ( unsigned  Width,
uint64_t  Value,
std::string  Description,
const MCFixup Fixup,
MCContext Ctx = nullptr 
)
static