blob: 182798630b5b4bad4e9076cb28d68e8d945a54a9 [file] [log] [blame]
Jia Liu13830222012-02-24 02:15:21 +00001//===-- ARMFixupKinds.h - ARM Specific Fixup Entries ------------*- C++ -*-===//
Jim Grosbach0fb841f2010-11-04 01:12:30 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_ARM_ARMFIXUPKINDS_H
11#define LLVM_ARM_ARMFIXUPKINDS_H
12
13#include "llvm/MC/MCFixup.h"
14
15namespace llvm {
16namespace ARM {
17enum Fixups {
Jim Grosbachce2bd8d2010-12-02 00:28:45 +000018 // fixup_arm_ldst_pcrel_12 - 12-bit PC relative relocation for symbol
19 // addresses
20 fixup_arm_ldst_pcrel_12 = FirstTargetFixupKind,
Jim Grosbachd96bd532010-12-14 21:28:29 +000021
Owen Anderson3e6ee1d2010-12-09 01:51:07 +000022 // fixup_t2_ldst_pcrel_12 - Equivalent to fixup_arm_ldst_pcrel_12, with
23 // the 16-bit halfwords reordered.
24 fixup_t2_ldst_pcrel_12,
Jim Grosbachd96bd532010-12-14 21:28:29 +000025
Jim Grosbach8648c102011-12-19 23:06:24 +000026 // fixup_arm_pcrel_10_unscaled - 10-bit PC relative relocation for symbol
27 // addresses used in LDRD/LDRH/LDRB/etc. instructions. All bits are encoded.
28 fixup_arm_pcrel_10_unscaled,
Owen Anderson943fb602010-12-01 19:18:46 +000029 // fixup_arm_pcrel_10 - 10-bit PC relative relocation for symbol addresses
Owen Anderson0f7142d2010-12-08 00:18:36 +000030 // used in VFP instructions where the lower 2 bits are not encoded
Owen Anderson943fb602010-12-01 19:18:46 +000031 // (so it's encoded as an 8-bit immediate).
32 fixup_arm_pcrel_10,
Owen Anderson0f7142d2010-12-08 00:18:36 +000033 // fixup_t2_pcrel_10 - Equivalent to fixup_arm_pcrel_10, accounting for
Owen Anderson302d5fd2010-12-09 00:27:41 +000034 // the short-swapped encoding of Thumb2 instructions.
Owen Anderson0f7142d2010-12-08 00:18:36 +000035 fixup_t2_pcrel_10,
Jim Grosbach509dc2a2010-12-14 22:28:03 +000036 // fixup_thumb_adr_pcrel_10 - 10-bit PC relative relocation for symbol
37 // addresses where the lower 2 bits are not encoded (so it's encoded as an
38 // 8-bit immediate).
39 fixup_thumb_adr_pcrel_10,
Jim Grosbachce2bd8d2010-12-02 00:28:45 +000040 // fixup_arm_adr_pcrel_12 - 12-bit PC relative relocation for the ADR
41 // instruction.
42 fixup_arm_adr_pcrel_12,
Owen Anderson6d375e52010-12-14 00:36:49 +000043 // fixup_t2_adr_pcrel_12 - 12-bit PC relative relocation for the ADR
44 // instruction.
45 fixup_t2_adr_pcrel_12,
Jason W Kimd2e2f562011-02-04 19:47:15 +000046 // fixup_arm_condbranch - 24-bit PC relative relocation for conditional branch
47 // instructions.
48 fixup_arm_condbranch,
49 // fixup_arm_uncondbranch - 24-bit PC relative relocation for
50 // branch instructions. (unconditional)
51 fixup_arm_uncondbranch,
Jim Grosbachd96bd532010-12-14 21:28:29 +000052 // fixup_t2_condbranch - 20-bit PC relative relocation for Thumb2 direct
Owen Anderson578074b2010-12-13 19:31:11 +000053 // uconditional branch instructions.
54 fixup_t2_condbranch,
Jim Grosbachd96bd532010-12-14 21:28:29 +000055 // fixup_t2_uncondbranch - 20-bit PC relative relocation for Thumb2 direct
Owen Anderson578074b2010-12-13 19:31:11 +000056 // branch unconditional branch instructions.
57 fixup_t2_uncondbranch,
Bill Wendlinga7d6aa92010-12-08 23:01:43 +000058
Jim Grosbache119da12010-12-10 18:21:33 +000059 // fixup_arm_thumb_br - 12-bit fixup for Thumb B instructions.
60 fixup_arm_thumb_br,
61
Jim Grosbach7b811d32012-02-27 21:36:23 +000062 // fixup_arm_bl - Fixup for ARM BL instructions.
63 fixup_arm_bl,
64
65 // fixup_arm_blx - Fixup for ARM BLX instructions.
66 fixup_arm_blx,
67
Eric Christopherbd59e892011-05-27 03:46:51 +000068 // fixup_arm_thumb_bl - Fixup for Thumb BL instructions.
Jim Grosbach9e199462010-12-06 23:57:07 +000069 fixup_arm_thumb_bl,
Jim Grosbach9d6d77a2010-11-11 18:04:49 +000070
Bill Wendling3392bfc2010-12-09 00:39:08 +000071 // fixup_arm_thumb_blx - Fixup for Thumb BLX instructions.
72 fixup_arm_thumb_blx,
73
Jim Grosbach68b27eb2010-12-09 19:50:12 +000074 // fixup_arm_thumb_cb - Fixup for Thumb branch instructions.
75 fixup_arm_thumb_cb,
Bill Wendlinga7d6aa92010-12-08 23:01:43 +000076
Bill Wendling8a6449c2010-12-08 01:57:09 +000077 // fixup_arm_thumb_cp - Fixup for Thumb load/store from constant pool instrs.
78 fixup_arm_thumb_cp,
79
Bill Wendling6ea30532010-12-14 22:26:49 +000080 // fixup_arm_thumb_bcc - Fixup for Thumb conditional branching instructions.
Jim Grosbach78485ad2010-12-10 17:13:40 +000081 fixup_arm_thumb_bcc,
82
Jason W Kim5a97bd82010-11-18 23:37:15 +000083 // The next two are for the movt/movw pair
84 // the 16bit imm field are split into imm{15-12} and imm{11-0}
Jason W Kim5a97bd82010-11-18 23:37:15 +000085 fixup_arm_movt_hi16, // :upper16:
86 fixup_arm_movw_lo16, // :lower16:
Evan Chengd4a5c052011-01-14 02:38:49 +000087 fixup_t2_movt_hi16, // :upper16:
88 fixup_t2_movw_lo16, // :lower16:
Jason W Kim5a97bd82010-11-18 23:37:15 +000089
Jason W Kim9c5b65d2011-01-12 00:19:25 +000090 // It is possible to create an "immediate" that happens to be pcrel.
Jason W Kim14558422011-01-12 23:25:02 +000091 // movw r0, :lower16:Foo-(Bar+8) and movt r0, :upper16:Foo-(Bar+8)
92 // result in different reloc tags than the above two.
Jason W Kim9c5b65d2011-01-12 00:19:25 +000093 // Needed to support ELF::R_ARM_MOVT_PREL and ELF::R_ARM_MOVW_PREL_NC
94 fixup_arm_movt_hi16_pcrel, // :upper16:
95 fixup_arm_movw_lo16_pcrel, // :lower16:
Evan Chengd4a5c052011-01-14 02:38:49 +000096 fixup_t2_movt_hi16_pcrel, // :upper16:
97 fixup_t2_movw_lo16_pcrel, // :lower16:
Jason W Kim9c5b65d2011-01-12 00:19:25 +000098
Jim Grosbach9d6d77a2010-11-11 18:04:49 +000099 // Marker
100 LastTargetFixupKind,
101 NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind
Jim Grosbach0fb841f2010-11-04 01:12:30 +0000102};
103}
104}
105
106#endif