LLVM  14.0.0git
riscv.h
Go to the documentation of this file.
1 //===-- riscv.h - Generic JITLink riscv edge kinds, utilities -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Generic utilities for graphs representing riscv objects.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_JITLINK_RISCV_H
14 #define LLVM_EXECUTIONENGINE_JITLINK_RISCV_H
15 
17 
18 namespace llvm {
19 namespace jitlink {
20 namespace riscv {
21 
22 /// Represets riscv fixups
24 
25  // TODO: Capture and replace to generic fixups
26  /// A plain 32-bit pointer value relocation
27  ///
28  /// Fixup expression:
29  /// Fixup <= Target + Addend : uint32
30  ///
32 
33  /// A plain 64-bit pointer value relocation
34  ///
35  /// Fixup expression:
36  /// Fixup <- Target + Addend : uint32
37  ///
39 
40  /// High 20 bits of 32-bit pointer value relocation
41  ///
42  /// Fixup expression
43  /// Fixup <- (Target + Addend + 0x800) >> 12
45 
46  /// Low 12 bits of 32-bit pointer value relocation
47  ///
48  /// Fixup expression
49  /// Fixup <- (Target + Addend) & 0xFFF
51  /// High 20 bits of PC relative relocation
52  ///
53  /// Fixup expression:
54  /// Fixup <- (Target - Fixup + Addend + 0x800) >> 12
56 
57  /// Low 12 bits of PC relative relocation, used by I type instruction format
58  ///
59  /// Fixup expression:
60  /// Fixup <- (Target - Fixup + Addend) & 0xFFF
62 
63  /// Low 12 bits of PC relative relocation, used by S type instruction format
64  ///
65  /// Fixup expression:
66  /// Fixup <- (Target - Fixup + Addend) & 0xFFF
68 
69  /// PC relative call
70  ///
71  /// Fixup expression:
72  /// Fixup <- (Target - Fixup + Addend)
74 
75  /// PC relative GOT offset
76  ///
77  /// Fixup expression:
78  /// Fixup <- (GOT - Fixup + Addend) >> 12
80 
81  /// PC relative call by PLT
82  ///
83  /// Fixup expression:
84  /// Fixup <- (Target - Fixup + Addend)
86 
87 };
88 
89 /// Returns a string name for the given riscv edge. For debugging purposes
90 /// only
91 const char *getEdgeKindName(Edge::Kind K);
92 } // namespace riscv
93 } // namespace jitlink
94 } // namespace llvm
95 
96 #endif
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23