LLVM  16.0.0git
aarch64.cpp
Go to the documentation of this file.
1 //===---- aarch64.cpp - Generic JITLink aarch64 edge kinds, utilities -----===//
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 aarch64 objects.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 
15 #define DEBUG_TYPE "jitlink"
16 
17 namespace llvm {
18 namespace jitlink {
19 namespace aarch64 {
20 
21 const char NullPointerContent[8] = {0x00, 0x00, 0x00, 0x00,
22  0x00, 0x00, 0x00, 0x00};
23 
24 const char PointerJumpStubContent[12] = {
25  0x10, 0x00, 0x00, (char)0x90u, // ADRP x16, <imm>@page21
26  0x10, 0x02, 0x40, (char)0xf9u, // LDR x16, [x16, <imm>@pageoff12]
27  0x00, 0x02, 0x1f, (char)0xd6u // BR x16
28 };
29 
30 const char *getEdgeKindName(Edge::Kind R) {
31  switch (R) {
32  case Pointer64:
33  return "Pointer64";
34  case Pointer32:
35  return "Pointer32";
36  case Delta64:
37  return "Delta64";
38  case Delta32:
39  return "Delta32";
40  case NegDelta64:
41  return "NegDelta64";
42  case NegDelta32:
43  return "NegDelta32";
44  case Branch26PCRel:
45  return "Branch26PCRel";
46  case MoveWide16:
47  return "MoveWide16";
48  case LDRLiteral19:
49  return "LDRLiteral19";
50  case Page21:
51  return "Page21";
52  case PageOffset12:
53  return "PageOffset12";
55  return "RequestGOTAndTransformToPage21";
57  return "RequestGOTAndTransformToPageOffset12";
59  return "RequestGOTAndTransformToDelta32";
61  return "RequestTLVPAndTransformToPage21";
63  return "RequestTLVPAndTransformToPageOffset12";
65  return "RequestTLSDescEntryAndTransformToPage21";
67  return "RequestTLSDescEntryAndTransformToPageOffset12";
68  default:
69  return getGenericEdgeKindName(static_cast<Edge::Kind>(R));
70  }
71 }
72 
73 } // namespace aarch64
74 } // namespace jitlink
75 } // namespace llvm
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
aarch64.h