From 83aa6d02d82007f57af92a4caeec6bf72aeb1fc0 Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Wed, 1 Apr 2015 03:07:01 +0000 Subject: [PATCH] [ELF][Hexagon] Add comments related to hexagon relocations. No functional changes. llvm-svn: 233783 --- .../ReaderWriter/ELF/Hexagon/HexagonEncodings.h | 1 + .../ELF/Hexagon/HexagonRelocationFunctions.h | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonEncodings.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonEncodings.h index 3e12786704a2..d7831533aee2 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonEncodings.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonEncodings.h @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// Instruction insn_encodings[] = { + // InsnMask CompareMask BitMask IsDuplexInstruction { 0xffe00004, 0x40000000, 0x20f8, 0x0 }, { 0xffe03080, 0x9ca03080, 0xf60, 0x0 }, { 0xf9e00000, 0x48c00000, 0x61f20ff, 0x0 }, diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h index 6bc6db28d9e2..8e57fec67c74 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationFunctions.h @@ -16,12 +16,15 @@ namespace lld { 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 { - uint32_t insnMask; - uint32_t insnCmpMask; - uint32_t insnBitMask; - bool isDuplex; + uint32_t insnMask; // Instruction mask. + uint32_t insnCmpMask; // Compare mask. + uint32_t insnBitMask; // Relocation mask. + bool isDuplex; // Indicates if the instruction is a duplex instruction. } Instruction; #include "HexagonEncodings.h" @@ -37,7 +40,7 @@ inline uint32_t findv4bitmask(uint8_t *location) { if (((insn_encodings[i].insnMask) & insn) == insn_encodings[i].insnCmpMask) return insn_encodings[i].insnBitMask; } - llvm_unreachable("found unknown instruction"); + llvm_unreachable("found unknown Hexagon instruction"); } } // elf