LLVM 23.0.0git
llvm::jitlink::hexagon Namespace Reference

Classes

struct  InstructionMask
 Instruction mask entry for R_HEX_6_X / R_HEX_16_X lookup. More...

Enumerations

enum  EdgeKind_hexagon : Edge::Kind {
  Pointer32 = Edge::FirstRelocation , PCRel32 , B22_PCREL , B15_PCREL ,
  B13_PCREL , B9_PCREL , B7_PCREL , HI16 ,
  LO16 , Word32_6_X , B32_PCREL_X , B22_PCREL_X ,
  B15_PCREL_X , B13_PCREL_X , B9_PCREL_X , B7_PCREL_X ,
  Word6_X , Word6_PCREL_X , Word8_X , Word9_X ,
  Word10_X , Word11_X , Word12_X , Word16_X
}
 Represents Hexagon fixup kinds. More...

Functions

LLVM_ABI const chargetEdgeKindName (Edge::Kind K)
 Returns a string name for the given Hexagon edge kind.
constexpr uint32_t applyMask (uint32_t Mask, uint32_t Data)
 Spread data bits into instruction word according to mask.
bool isDuplex (uint32_t Insn)
Expected< uint32_tfindMaskR6 (uint32_t Insn)
Expected< uint32_tfindMaskR8 (uint32_t Insn)
Expected< uint32_tfindMaskR11 (uint32_t Insn)
Expected< uint32_tfindMaskR16 (uint32_t Insn)
Error applyFixup (LinkGraph &G, Block &B, const Edge &E)
 Apply fixup expression for edge to block content.

Variables

constexpr uint32_t PointerSize = 4
 Hexagon pointer size.
constexpr InstructionMask R6Masks []
 Mask table for R_HEX_6_X relocations, indexed by instruction class.
constexpr uint32_t InstParsePacketEnd = 0x0000c000

Enumeration Type Documentation

◆ EdgeKind_hexagon

Represents Hexagon fixup kinds.

Enumerator
Pointer32 

Full 32-bit absolute pointer.

Fixup <- Target + Addend : uint32

PCRel32 

32-bit PC-relative.

Fixup <- Target - Fixup + Addend : int32

B22_PCREL 

22-bit PC-relative branch (shifted right by 2).

Fixup <- (Target - Fixup + Addend) >> 2 : int22 Mask: 0x01ff3ffe

B15_PCREL 

15-bit PC-relative branch (shifted right by 2).

Fixup <- (Target - Fixup + Addend) >> 2 : int15 Mask: 0x00df20fe

B13_PCREL 

13-bit PC-relative branch (shifted right by 2).

Fixup <- (Target - Fixup + Addend) >> 2 : int13 Mask: 0x00202ffe

B9_PCREL 

9-bit PC-relative branch (shifted right by 2).

Fixup <- (Target - Fixup + Addend) >> 2 : int9 Mask: 0x003000fe

B7_PCREL 

7-bit PC-relative branch (shifted right by 2).

Fixup <- (Target - Fixup + Addend) >> 2 : int7 Mask: 0x00001f18

HI16 

High 16 bits of absolute address.

Fixup <- (Target + Addend) >> 16 Mask: 0x00c03fff

LO16 

Low 16 bits of absolute address.

Fixup <- (Target + Addend) & 0xffff Mask: 0x00c03fff

Word32_6_X 

32-bit absolute, upper 26 bits via constant extender (shifted right by 6).

Fixup <- (Target + Addend) >> 6 Mask: 0x0fff3fff

B32_PCREL_X 

32-bit PC-relative, upper 26 bits via constant extender (shifted by 6).

Fixup <- (Target - Fixup + Addend) >> 6 Mask: 0x0fff3fff

B22_PCREL_X 

22-bit PC-relative branch, lower 6 bits via extender.

Fixup <- (Target - Fixup + Addend) & 0x3f Mask: 0x01ff3ffe

B15_PCREL_X 

15-bit PC-relative branch, lower 6 bits via extender.

Fixup <- (Target - Fixup + Addend) & 0x3f Mask: 0x00df20fe

B13_PCREL_X 

13-bit PC-relative branch, lower 6 bits via extender.

Fixup <- (Target - Fixup + Addend) & 0x3f Mask: 0x00202ffe

B9_PCREL_X 

9-bit PC-relative branch, lower 6 bits via extender.

Fixup <- (Target - Fixup + Addend) & 0x3f Mask: 0x003000fe

B7_PCREL_X 

7-bit PC-relative branch, lower 6 bits via extender.

Fixup <- (Target - Fixup + Addend) & 0x3f Mask: 0x00001f18

Word6_X 

6-bit absolute extended.

Fixup <- (Target + Addend) & mask (instruction-dependent)

Word6_PCREL_X 

6-bit PC-relative extended.

Fixup <- (Target - Fixup + Addend) & mask (instruction-dependent)

Word8_X 

8-bit absolute extended.

Word9_X 

9-bit absolute extended (6 effective bits).

Word10_X 

10-bit absolute extended (6 effective bits).

Word11_X 

11-bit absolute extended (6 effective bits).

Word12_X 

12-bit absolute extended.

Word16_X 

16-bit absolute extended (6 effective bits).

Definition at line 23 of file hexagon.h.

Function Documentation

◆ applyFixup()

◆ applyMask()

uint32_t llvm::jitlink::hexagon::applyMask ( uint32_t Mask,
uint32_t Data )
constexpr

Spread data bits into instruction word according to mask.

For each set bit in mask (scanning low to high), the corresponding bit position in the result gets the next data bit.

Definition at line 138 of file hexagon.h.

References llvm::Data.

Referenced by applyFixup().

◆ findMaskR11()

Expected< uint32_t > llvm::jitlink::hexagon::findMaskR11 ( uint32_t Insn)
inline

Definition at line 199 of file hexagon.h.

References isDuplex().

Referenced by applyFixup().

◆ findMaskR16()

Expected< uint32_t > llvm::jitlink::hexagon::findMaskR16 ( uint32_t Insn)
inline

Definition at line 207 of file hexagon.h.

References I, InstParsePacketEnd, isDuplex(), llvm::make_error(), R6Masks, and llvm::utohexstr().

Referenced by applyFixup().

◆ findMaskR6()

Expected< uint32_t > llvm::jitlink::hexagon::findMaskR6 ( uint32_t Insn)
inline

Definition at line 178 of file hexagon.h.

References I, isDuplex(), llvm::make_error(), R6Masks, and llvm::utohexstr().

Referenced by applyFixup().

◆ findMaskR8()

Expected< uint32_t > llvm::jitlink::hexagon::findMaskR8 ( uint32_t Insn)
inline

Definition at line 189 of file hexagon.h.

References isDuplex().

Referenced by applyFixup().

◆ getEdgeKindName()

const char * llvm::jitlink::hexagon::getEdgeKindName ( Edge::Kind K)

◆ isDuplex()

bool llvm::jitlink::hexagon::isDuplex ( uint32_t Insn)
inline

Definition at line 176 of file hexagon.h.

References InstParsePacketEnd.

Referenced by findMaskR11(), findMaskR16(), findMaskR6(), and findMaskR8().

Variable Documentation

◆ InstParsePacketEnd

uint32_t llvm::jitlink::hexagon::InstParsePacketEnd = 0x0000c000
inlineconstexpr

Definition at line 174 of file hexagon.h.

Referenced by findMaskR16(), and isDuplex().

◆ PointerSize

uint32_t llvm::jitlink::hexagon::PointerSize = 4
constexpr

Hexagon pointer size.

Definition at line 133 of file hexagon.h.

◆ R6Masks

InstructionMask llvm::jitlink::hexagon::R6Masks[]
inlineconstexpr
Initial value:
= {
{0x38000000, 0x0000201f}, {0x39000000, 0x0000201f},
{0x3e000000, 0x00001f80}, {0x3f000000, 0x00001f80},
{0x40000000, 0x000020f8}, {0x41000000, 0x000007e0},
{0x42000000, 0x000020f8}, {0x43000000, 0x000007e0},
{0x44000000, 0x000020f8}, {0x45000000, 0x000007e0},
{0x46000000, 0x000020f8}, {0x47000000, 0x000007e0},
{0x6a000000, 0x00001f80}, {0x7c000000, 0x001f2000},
{0x9a000000, 0x00000f60}, {0x9b000000, 0x00000f60},
{0x9c000000, 0x00000f60}, {0x9d000000, 0x00000f60},
{0x9f000000, 0x001f0100}, {0xab000000, 0x0000003f},
{0xad000000, 0x0000003f}, {0xaf000000, 0x00030078},
{0xd7000000, 0x006020e0}, {0xd8000000, 0x006020e0},
{0xdb000000, 0x006020e0}, {0xdf000000, 0x006020e0}}

Mask table for R_HEX_6_X relocations, indexed by instruction class.

Definition at line 159 of file hexagon.h.

Referenced by findMaskR16(), and findMaskR6().