1 //===-- ARMFixupKinds.h - ARM Specific Fixup Entries ------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMFIXUPKINDS_H
10 #define LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMFIXUPKINDS_H
12 #include "llvm/MC/MCFixup.h"
17 // 12-bit PC relative relocation for symbol addresses
18 fixup_arm_ldst_pcrel_12
= FirstTargetFixupKind
,
20 // Equivalent to fixup_arm_ldst_pcrel_12, with the 16-bit halfwords reordered.
21 fixup_t2_ldst_pcrel_12
,
23 // 10-bit PC relative relocation for symbol addresses used in
24 // LDRD/LDRH/LDRB/etc. instructions. All bits are encoded.
25 fixup_arm_pcrel_10_unscaled
,
26 // 10-bit PC relative relocation for symbol addresses used in VFP instructions
27 // where the lower 2 bits are not encoded (so it's encoded as an 8-bit
30 // Equivalent to fixup_arm_pcrel_10, accounting for the short-swapped encoding
31 // of Thumb2 instructions.
33 // 9-bit PC relative relocation for symbol addresses used in VFP instructions
34 // where bit 0 not encoded (so it's encoded as an 8-bit immediate).
36 // Equivalent to fixup_arm_pcrel_9, accounting for the short-swapped encoding
37 // of Thumb2 instructions.
39 // 10-bit PC relative relocation for symbol addresses where the lower 2 bits
40 // are not encoded (so it's encoded as an 8-bit immediate).
41 fixup_thumb_adr_pcrel_10
,
42 // 12-bit PC relative relocation for the ADR instruction.
43 fixup_arm_adr_pcrel_12
,
44 // 12-bit PC relative relocation for the ADR instruction.
45 fixup_t2_adr_pcrel_12
,
46 // 24-bit PC relative relocation for conditional branch instructions.
48 // 24-bit PC relative relocation for branch instructions. (unconditional)
49 fixup_arm_uncondbranch
,
50 // 20-bit PC relative relocation for Thumb2 direct uconditional branch
53 // 20-bit PC relative relocation for Thumb2 direct branch unconditional branch
55 fixup_t2_uncondbranch
,
57 // 12-bit fixup for Thumb B instructions.
60 // The following fixups handle the ARM BL instructions. These can be
61 // conditionalised; however, the ARM ELF ABI requires a different relocation
62 // in that case: R_ARM_JUMP24 instead of R_ARM_CALL. The difference is that
63 // R_ARM_CALL is allowed to change the instruction to a BLX inline, which has
64 // no conditional version; R_ARM_JUMP24 would have to insert a veneer.
66 // MachO does not draw a distinction between the two cases, so it will treat
67 // fixup_arm_uncondbl and fixup_arm_condbl as identical fixups.
69 // Fixup for unconditional ARM BL instructions.
72 // Fixup for ARM BL instructions with nontrivial conditionalisation.
75 // Fixup for ARM BLX instructions.
78 // Fixup for Thumb BL instructions.
81 // Fixup for Thumb BLX instructions.
84 // Fixup for Thumb branch instructions.
87 // Fixup for Thumb load/store from constant pool instrs.
90 // Fixup for Thumb conditional branching instructions.
93 // The next two are for the movt/movw pair
94 // the 16bit imm field are split into imm{15-12} and imm{11-0}
95 fixup_arm_movt_hi16
, // :upper16:
96 fixup_arm_movw_lo16
, // :lower16:
97 fixup_t2_movt_hi16
, // :upper16:
98 fixup_t2_movw_lo16
, // :lower16:
103 // Fixup for Thumb2 8-bit rotated operand
106 // Fixups for Branch Future.
111 fixup_bfcsel_else_target
,
117 NumTargetFixupKinds
= LastTargetFixupKind
- FirstTargetFixupKind