Skip to content

Commit 8d99bf9

Browse files
[JITLink][AArch32] Revisit descriptions for Call and Jump24 relocation types (NFC)
1 parent 21ee9e4 commit 8d99bf9

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ enum EdgeKind_aarch32 : Edge::Kind {
4848
///
4949
FirstArmRelocation,
5050

51-
/// Write immediate value for PC-relative branch with link (can bridge between
52-
/// Arm and Thumb).
51+
/// Write immediate value for unconditional PC-relative branch with link.
52+
/// We patch the instruction opcode to account for an instruction-set state
53+
/// switch: we use the bl instruction to stay in ARM and the blx instruction
54+
/// to switch to Thumb.
5355
Arm_Call = FirstArmRelocation,
5456

55-
/// Write immediate value for (unconditional) PC-relative branch without link.
57+
/// Write immediate value for conditional PC-relative branch without link.
58+
/// If the branch target is not ARM, we are forced to generate an explicit
59+
/// interworking stub.
5660
Arm_Jump24,
5761

5862
LastArmRelocation = Arm_Jump24,
@@ -62,11 +66,15 @@ enum EdgeKind_aarch32 : Edge::Kind {
6266
///
6367
FirstThumbRelocation,
6468

65-
/// Write immediate value for PC-relative branch with link (can bridge between
66-
/// Arm and Thumb).
69+
/// Write immediate value for unconditional PC-relative branch with link.
70+
/// We patch the instruction opcode to account for an instruction-set state
71+
/// switch: we use the bl instruction to stay in Thumb and the blx instruction
72+
/// to switch to ARM.
6773
Thumb_Call = FirstThumbRelocation,
6874

69-
/// Write immediate value for (unconditional) PC-relative branch without link.
75+
/// Write immediate value for PC-relative branch without link. The instruction
76+
/// can be made conditional by an IT block. If the branch target is not ARM,
77+
/// we are forced to generate an explicit interworking stub.
7078
Thumb_Jump24,
7179

7280
/// Write immediate value to the lower halfword of the destination register

llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ TEST(AArch32_Relocations, Thumb_MovtAbs) {
234234
EXPECT_EQ(EncodeDecode(0xffff, Mem), 0xffff); // Maximum value
235235
EXPECT_NE(EncodeDecode(0x10000, Mem), 0x10000); // First overflow
236236

237-
// Destination register as well as unaffacted bits should be intact
237+
// Destination register as well as unaffected bits should be intact
238238
EXPECT_EQ(decodeRegMovtT1MovwT3(Mem.Hi, Mem.Lo), Reg);
239239
EXPECT_TRUE(UnaffectedBits.Hi == (Mem.Hi & ~(ImmMask.Hi | RegMask.Hi)) &&
240240
UnaffectedBits.Lo == (Mem.Lo & ~(ImmMask.Lo | RegMask.Lo)))

0 commit comments

Comments
 (0)