xref: /freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
10b57cec5SDimitry Andric //===-- PPCFixupKinds.h - PPC Specific Fixup Entries ------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_POWERPC_MCTARGETDESC_PPCFIXUPKINDS_H
100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_POWERPC_MCTARGETDESC_PPCFIXUPKINDS_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "llvm/MC/MCFixup.h"
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric #undef PPC
150b57cec5SDimitry Andric 
160b57cec5SDimitry Andric namespace llvm {
170b57cec5SDimitry Andric namespace PPC {
180b57cec5SDimitry Andric enum Fixups {
190b57cec5SDimitry Andric   // 24-bit PC relative relocation for direct branches like 'b' and 'bl'.
200b57cec5SDimitry Andric   fixup_ppc_br24 = FirstTargetFixupKind,
210b57cec5SDimitry Andric 
225ffd83dbSDimitry Andric   // 24-bit PC relative relocation for direct branches like 'b' and 'bl' where
235ffd83dbSDimitry Andric   // the caller does not use the TOC.
245ffd83dbSDimitry Andric   fixup_ppc_br24_notoc,
255ffd83dbSDimitry Andric 
260b57cec5SDimitry Andric   /// 14-bit PC relative relocation for conditional branches.
270b57cec5SDimitry Andric   fixup_ppc_brcond14,
280b57cec5SDimitry Andric 
290b57cec5SDimitry Andric   /// 24-bit absolute relocation for direct branches like 'ba' and 'bla'.
300b57cec5SDimitry Andric   fixup_ppc_br24abs,
310b57cec5SDimitry Andric 
320b57cec5SDimitry Andric   /// 14-bit absolute relocation for conditional branches.
330b57cec5SDimitry Andric   fixup_ppc_brcond14abs,
340b57cec5SDimitry Andric 
350b57cec5SDimitry Andric   /// A 16-bit fixup corresponding to lo16(_foo) or ha16(_foo) for instrs like
360b57cec5SDimitry Andric   /// 'li' or 'addis'.
370b57cec5SDimitry Andric   fixup_ppc_half16,
380b57cec5SDimitry Andric 
390b57cec5SDimitry Andric   /// A 14-bit fixup corresponding to lo16(_foo) with implied 2 zero bits for
400b57cec5SDimitry Andric   /// instrs like 'std'.
410b57cec5SDimitry Andric   fixup_ppc_half16ds,
420b57cec5SDimitry Andric 
435ffd83dbSDimitry Andric   // A 34-bit fixup corresponding to PC-relative paddi.
445ffd83dbSDimitry Andric   fixup_ppc_pcrel34,
455ffd83dbSDimitry Andric 
46e8d8bef9SDimitry Andric   // A 34-bit fixup corresponding to Non-PC-relative paddi.
47e8d8bef9SDimitry Andric   fixup_ppc_imm34,
48e8d8bef9SDimitry Andric 
490b57cec5SDimitry Andric   /// Not a true fixup, but ties a symbol to a call to __tls_get_addr for the
500b57cec5SDimitry Andric   /// TLS general and local dynamic models, or inserts the thread-pointer
51*06c3fb27SDimitry Andric   /// register number. It can also be used to tie the ref symbol to prevent it
52*06c3fb27SDimitry Andric   /// from being garbage collected on AIX.
530b57cec5SDimitry Andric   fixup_ppc_nofixup,
540b57cec5SDimitry Andric 
553a9a9c0cSDimitry Andric   /// A 16-bit fixup corresponding to lo16(_foo) with implied 3 zero bits for
563a9a9c0cSDimitry Andric   /// instrs like 'lxv'. Produces the same relocation as fixup_ppc_half16ds.
573a9a9c0cSDimitry Andric   fixup_ppc_half16dq,
583a9a9c0cSDimitry Andric 
590b57cec5SDimitry Andric   // Marker
600b57cec5SDimitry Andric   LastTargetFixupKind,
610b57cec5SDimitry Andric   NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind
620b57cec5SDimitry Andric };
630b57cec5SDimitry Andric }
640b57cec5SDimitry Andric }
650b57cec5SDimitry Andric 
660b57cec5SDimitry Andric #endif
67