blob: 9425f2226138a1b983e78f6fc936cb4247543a4c [file] [log] [blame]
Jim Grosbach70933262010-11-04 01:12:30 +00001//===-- ARM/ARMFixupKinds.h - ARM Specific Fixup Entries --------*- C++ -*-===//
2//
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 Grosbachdff84b02010-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 Grosbach8d6d7d62010-12-14 21:28:29 +000021
Owen Andersond7b3f582010-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 Grosbach8d6d7d62010-12-14 21:28:29 +000025
Owen Anderson9d63d902010-12-01 19:18:46 +000026 // fixup_arm_pcrel_10 - 10-bit PC relative relocation for symbol addresses
Owen Andersond8e351b2010-12-08 00:18:36 +000027 // used in VFP instructions where the lower 2 bits are not encoded
Owen Anderson9d63d902010-12-01 19:18:46 +000028 // (so it's encoded as an 8-bit immediate).
29 fixup_arm_pcrel_10,
Owen Andersond8e351b2010-12-08 00:18:36 +000030 // fixup_t2_pcrel_10 - Equivalent to fixup_arm_pcrel_10, accounting for
Owen Andersonfb20d892010-12-09 00:27:41 +000031 // the short-swapped encoding of Thumb2 instructions.
Owen Andersond8e351b2010-12-08 00:18:36 +000032 fixup_t2_pcrel_10,
Jim Grosbachd40963c2010-12-14 22:28:03 +000033 // fixup_thumb_adr_pcrel_10 - 10-bit PC relative relocation for symbol
34 // addresses where the lower 2 bits are not encoded (so it's encoded as an
35 // 8-bit immediate).
36 fixup_thumb_adr_pcrel_10,
Jim Grosbachdff84b02010-12-02 00:28:45 +000037 // fixup_arm_adr_pcrel_12 - 12-bit PC relative relocation for the ADR
38 // instruction.
39 fixup_arm_adr_pcrel_12,
Owen Andersona838a252010-12-14 00:36:49 +000040 // fixup_t2_adr_pcrel_12 - 12-bit PC relative relocation for the ADR
41 // instruction.
42 fixup_t2_adr_pcrel_12,
Jim Grosbach662a8162010-12-06 23:57:07 +000043 // fixup_arm_branch - 24-bit PC relative relocation for direct branch
Jim Grosbachc466b932010-11-11 18:04:49 +000044 // instructions.
45 fixup_arm_branch,
Jim Grosbach8d6d7d62010-12-14 21:28:29 +000046 // fixup_t2_condbranch - 20-bit PC relative relocation for Thumb2 direct
Owen Andersonc2666002010-12-13 19:31:11 +000047 // uconditional branch instructions.
48 fixup_t2_condbranch,
Jim Grosbach8d6d7d62010-12-14 21:28:29 +000049 // fixup_t2_uncondbranch - 20-bit PC relative relocation for Thumb2 direct
Owen Andersonc2666002010-12-13 19:31:11 +000050 // branch unconditional branch instructions.
51 fixup_t2_uncondbranch,
Bill Wendlingdff2f712010-12-08 23:01:43 +000052
Jim Grosbache2467172010-12-10 18:21:33 +000053 // fixup_arm_thumb_br - 12-bit fixup for Thumb B instructions.
54 fixup_arm_thumb_br,
55
Bill Wendling09aa3f02010-12-09 00:39:08 +000056 // fixup_arm_thumb_blx - Fixup for Thumb BL instructions.
Jim Grosbach662a8162010-12-06 23:57:07 +000057 fixup_arm_thumb_bl,
Jim Grosbachc466b932010-11-11 18:04:49 +000058
Bill Wendling09aa3f02010-12-09 00:39:08 +000059 // fixup_arm_thumb_blx - Fixup for Thumb BLX instructions.
60 fixup_arm_thumb_blx,
61
Jim Grosbachb492a7c2010-12-09 19:50:12 +000062 // fixup_arm_thumb_cb - Fixup for Thumb branch instructions.
63 fixup_arm_thumb_cb,
Bill Wendlingdff2f712010-12-08 23:01:43 +000064
Bill Wendlingb8958b02010-12-08 01:57:09 +000065 // fixup_arm_thumb_cp - Fixup for Thumb load/store from constant pool instrs.
66 fixup_arm_thumb_cp,
67
Bill Wendlingee2b3502010-12-14 22:26:49 +000068 // fixup_arm_thumb_bcc - Fixup for Thumb conditional branching instructions.
Jim Grosbach01086452010-12-10 17:13:40 +000069 fixup_arm_thumb_bcc,
70
Jason W Kim837caa92010-11-18 23:37:15 +000071 // The next two are for the movt/movw pair
72 // the 16bit imm field are split into imm{15-12} and imm{11-0}
Jason W Kim837caa92010-11-18 23:37:15 +000073 fixup_arm_movt_hi16, // :upper16:
74 fixup_arm_movw_lo16, // :lower16:
Evan Chengf3eb3bb2011-01-14 02:38:49 +000075 fixup_t2_movt_hi16, // :upper16:
76 fixup_t2_movw_lo16, // :lower16:
Jason W Kim837caa92010-11-18 23:37:15 +000077
Jason W Kim86a97f22011-01-12 00:19:25 +000078 // It is possible to create an "immediate" that happens to be pcrel.
Jason W Kim8dc602d2011-01-12 23:25:02 +000079 // movw r0, :lower16:Foo-(Bar+8) and movt r0, :upper16:Foo-(Bar+8)
80 // result in different reloc tags than the above two.
Jason W Kim86a97f22011-01-12 00:19:25 +000081 // Needed to support ELF::R_ARM_MOVT_PREL and ELF::R_ARM_MOVW_PREL_NC
82 fixup_arm_movt_hi16_pcrel, // :upper16:
83 fixup_arm_movw_lo16_pcrel, // :lower16:
Evan Chengf3eb3bb2011-01-14 02:38:49 +000084 fixup_t2_movt_hi16_pcrel, // :upper16:
85 fixup_t2_movw_lo16_pcrel, // :lower16:
Jason W Kim86a97f22011-01-12 00:19:25 +000086
Jim Grosbachc466b932010-11-11 18:04:49 +000087 // Marker
88 LastTargetFixupKind,
89 NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind
Jim Grosbach70933262010-11-04 01:12:30 +000090};
91}
92}
93
94#endif