1234353Sdim//===-- PPCRelocations.h - PPC Code Relocations -----------------*- C++ -*-===//
2193323Sed//
3193323Sed//                     The LLVM Compiler Infrastructure
4193323Sed//
5193323Sed// This file is distributed under the University of Illinois Open Source
6193323Sed// License. See LICENSE.TXT for details.
7193323Sed//
8193323Sed//===----------------------------------------------------------------------===//
9193323Sed//
10193323Sed// This file defines the PowerPC 32-bit target-specific relocation types.
11193323Sed//
12193323Sed//===----------------------------------------------------------------------===//
13193323Sed
14234353Sdim#ifndef PPCRELOCATIONS_H
15234353Sdim#define PPCRELOCATIONS_H
16193323Sed
17193323Sed#include "llvm/CodeGen/MachineRelocation.h"
18193323Sed
19193323Sed// Hack to rid us of a PPC pre-processor symbol which is erroneously
20193323Sed// defined in a PowerPC header file (bug in Linux/PPC)
21193323Sed#ifdef PPC
22193323Sed#undef PPC
23193323Sed#endif
24193323Sed
25193323Sednamespace llvm {
26193323Sed  namespace PPC {
27193323Sed    enum RelocationType {
28193323Sed      // reloc_vanilla - A standard relocation, where the address of the
29193323Sed      // relocated object completely overwrites the address of the relocation.
30193323Sed      reloc_vanilla,
31193323Sed
32193323Sed      // reloc_pcrel_bx - PC relative relocation, for the b or bl instructions.
33193323Sed      reloc_pcrel_bx,
34193323Sed
35193323Sed      // reloc_pcrel_bcx - PC relative relocation, for BLT,BLE,BEQ,BGE,BGT,BNE,
36193323Sed      // and other bcx instructions.
37193323Sed      reloc_pcrel_bcx,
38193323Sed
39193323Sed      // reloc_absolute_high - Absolute relocation, for the loadhi instruction
40193323Sed      // (which is really addis).  Add the high 16-bits of the specified global
41193323Sed      // address into the low 16-bits of the instruction.
42193323Sed      reloc_absolute_high,
43193323Sed
44193323Sed      // reloc_absolute_low - Absolute relocation, for the la instruction (which
45193323Sed      // is really an addi).  Add the low 16-bits of the specified global
46193323Sed      // address into the low 16-bits of the instruction.
47193323Sed      reloc_absolute_low,
48193323Sed
49193323Sed      // reloc_absolute_low_ix - Absolute relocation for the 64-bit load/store
50193323Sed      // instruction which have two implicit zero bits.
51193323Sed      reloc_absolute_low_ix
52193323Sed    };
53193323Sed  }
54193323Sed}
55193323Sed
56193323Sed#endif
57