forked from OSchip/llvm-project
[ELF][Hexagon] Add comments related to hexagon relocations.
No functional changes. llvm-svn: 233783
This commit is contained in:
parent
ee39d33175
commit
83aa6d02d8
|
@ -7,6 +7,7 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
Instruction insn_encodings[] = {
|
Instruction insn_encodings[] = {
|
||||||
|
// InsnMask CompareMask BitMask IsDuplexInstruction
|
||||||
{ 0xffe00004, 0x40000000, 0x20f8, 0x0 },
|
{ 0xffe00004, 0x40000000, 0x20f8, 0x0 },
|
||||||
{ 0xffe03080, 0x9ca03080, 0xf60, 0x0 },
|
{ 0xffe03080, 0x9ca03080, 0xf60, 0x0 },
|
||||||
{ 0xf9e00000, 0x48c00000, 0x61f20ff, 0x0 },
|
{ 0xf9e00000, 0x48c00000, 0x61f20ff, 0x0 },
|
||||||
|
|
|
@ -16,12 +16,15 @@
|
||||||
namespace lld {
|
namespace lld {
|
||||||
namespace elf {
|
namespace elf {
|
||||||
|
|
||||||
/// \brief HexagonInstruction which is used to store various values
|
/// \brief Applying fixup on Hexagon requires the relocator to fetch the fixup
|
||||||
|
/// mask from the instruction. To fetch the fixup encoding, the linker uses a
|
||||||
|
/// static array that contains the instruction mask, the compare mask and the
|
||||||
|
/// relocation mask.
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t insnMask;
|
uint32_t insnMask; // Instruction mask.
|
||||||
uint32_t insnCmpMask;
|
uint32_t insnCmpMask; // Compare mask.
|
||||||
uint32_t insnBitMask;
|
uint32_t insnBitMask; // Relocation mask.
|
||||||
bool isDuplex;
|
bool isDuplex; // Indicates if the instruction is a duplex instruction.
|
||||||
} Instruction;
|
} Instruction;
|
||||||
|
|
||||||
#include "HexagonEncodings.h"
|
#include "HexagonEncodings.h"
|
||||||
|
@ -37,7 +40,7 @@ inline uint32_t findv4bitmask(uint8_t *location) {
|
||||||
if (((insn_encodings[i].insnMask) & insn) == insn_encodings[i].insnCmpMask)
|
if (((insn_encodings[i].insnMask) & insn) == insn_encodings[i].insnCmpMask)
|
||||||
return insn_encodings[i].insnBitMask;
|
return insn_encodings[i].insnBitMask;
|
||||||
}
|
}
|
||||||
llvm_unreachable("found unknown instruction");
|
llvm_unreachable("found unknown Hexagon instruction");
|
||||||
}
|
}
|
||||||
|
|
||||||
} // elf
|
} // elf
|
||||||
|
|
Loading…
Reference in New Issue