32 XtensaAsmBackend(
uint8_t osABI,
bool isLE)
34 IsLittleEndian(isLE) {}
44 std::unique_ptr<MCObjectTargetWriter> createObjectTargetWriter()
const override {
53 {
"fixup_xtensa_branch_6", 0, 16, 0},
54 {
"fixup_xtensa_branch_8", 16, 8, 0},
55 {
"fixup_xtensa_branch_12", 12, 12, 0},
56 {
"fixup_xtensa_jump_18", 6, 18, 0},
57 {
"fixup_xtensa_call_18", 6, 18, 0},
58 {
"fixup_xtensa_l32r_16", 8, 16, 0},
59 {
"fixup_xtensa_loop_8", 16, 8, 0},
71 unsigned Kind =
Fixup.getKind();
84 if (!isUInt<6>(
Value))
86 unsigned Hi2 = (
Value >> 4) & 0x3;
87 unsigned Lo4 =
Value & 0xf;
88 return (Hi2 << 4) | (Lo4 << 12);
94 return (
Value & 0xff);
97 if (!isInt<12>(
Value))
99 return (
Value & 0xfff);
102 if (!isInt<18>(
Value))
104 return (
Value & 0x3ffff);
107 if (!isInt<20>(
Value))
111 return (
Value & 0xffffc) >> 2;
114 if (!isUInt<8>(
Value))
116 return (
Value & 0xff);
125 return (
Value & 0x3fffc) >> 2;
140std::optional<bool> XtensaAsmBackend::evaluateFixup(
const MCFragment &
F,
146 switch (
Fixup.getKind()) {
171 for (
unsigned i = 0; i != FullSize; ++i) {
180 for (
uint64_t i = 0; i != NumNops24b; ++i) {
183 if (IsLittleEndian) {
216 return new XtensaAsmBackend(OSABI,
true);
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Analysis containing CSE Info
PowerPC TLS Dynamic Call Fixup
static unsigned getSize(unsigned Kind)
static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value, MCContext &Ctx)
Generic interface to target specific assembler backends.
virtual MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
Context object for machine code objects.
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Base class for classes that define behaviour that is specific to both the target and the object forma...
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
Target - Wrapper for Target specific information.
OSType getOS() const
Get the parsed operating system type of this triple.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write(unsigned char C)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Error applyFixup(LinkGraph &G, Block &B, const Edge &E, const ArmConfig &ArmCfg)
Apply fixup expression for edge to block content.
This is an optimization pass for GlobalISel generic memory operations.
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_1
A one-byte fixup.
@ FK_Data_4
A four-byte fixup.
@ FK_Data_2
A two-byte fixup.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
std::unique_ptr< MCObjectTargetWriter > createXtensaObjectWriter(uint8_t OSABI, bool IsLittleEndian)
MCAsmBackend * createXtensaAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Target independent information on a fixup kind.