blob: 0787ed399d5f39d5eaece288425707e6e8547e56 [file] [log] [blame]
Jia Liubb481f82012-02-28 07:46:26 +00001//===-- MipsRelocations.h - Mips Code Relocations ---------------*- C++ -*-===//
Bruno Cardoso Lopesdca6cdd2011-07-21 16:28:51 +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//
Jia Liubb481f82012-02-28 07:46:26 +00008//===----------------------------------------------------------------------===//
Bruno Cardoso Lopesdca6cdd2011-07-21 16:28:51 +00009//
10// This file defines the Mips target-specific relocation types
11// (for relocation-model=static).
12//
Jia Liubb481f82012-02-28 07:46:26 +000013//===----------------------------------------------------------------------===//
Bruno Cardoso Lopesdca6cdd2011-07-21 16:28:51 +000014
15#ifndef MIPSRELOCATIONS_H_
16#define MIPSRELOCATIONS_H_
17
18#include "llvm/CodeGen/MachineRelocation.h"
19
20namespace llvm {
21 namespace Mips{
22 enum RelocationType {
Bruno Cardoso Lopes3aa035f2011-12-30 21:04:30 +000023 // reloc_mips_pc16 - pc relative relocation for branches. The lower 18
Bruno Cardoso Lopesc4cc40c2011-09-14 03:00:41 +000024 // bits of the difference between the branch target and the branch
25 // instruction, shifted right by 2.
Bruno Cardoso Lopes3aa035f2011-12-30 21:04:30 +000026 reloc_mips_pc16 = 1,
Bruno Cardoso Lopesc4cc40c2011-09-14 03:00:41 +000027
28 // reloc_mips_hi - upper 16 bits of the address (modified by +1 if the
29 // lower 16 bits of the address is negative).
30 reloc_mips_hi = 2,
31
32 // reloc_mips_lo - lower 16 bits of the address.
33 reloc_mips_lo = 3,
34
35 // reloc_mips_26 - lower 28 bits of the address, shifted right by 2.
Akira Hatanaka008b58c2011-10-14 17:16:39 +000036 reloc_mips_26 = 4
Bruno Cardoso Lopesdca6cdd2011-07-21 16:28:51 +000037 };
38 }
39}
40
41#endif /* MIPSRELOCATIONS_H_ */