1 //===---- aarch64.cpp - Generic JITLink aarch64 edge kinds, utilities -----===//
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
7 //===----------------------------------------------------------------------===//
9 // Generic utilities for graphs representing aarch64 objects.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/ExecutionEngine/JITLink/aarch64.h"
15 #define DEBUG_TYPE "jitlink"
21 const char NullPointerContent
[8] = {0x00, 0x00, 0x00, 0x00,
22 0x00, 0x00, 0x00, 0x00};
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
30 const char *getEdgeKindName(Edge::Kind R
) {
45 return "Branch26PCRel";
49 return "LDRLiteral19";
50 case TestAndBranch14PCRel
:
51 return "TestAndBranch14PCRel";
52 case CondBranch19PCRel
:
53 return "CondBranch19PCRel";
55 return "ADRLiteral21";
59 return "PageOffset12";
60 case RequestGOTAndTransformToPage21
:
61 return "RequestGOTAndTransformToPage21";
62 case RequestGOTAndTransformToPageOffset12
:
63 return "RequestGOTAndTransformToPageOffset12";
64 case RequestGOTAndTransformToDelta32
:
65 return "RequestGOTAndTransformToDelta32";
66 case RequestTLVPAndTransformToPage21
:
67 return "RequestTLVPAndTransformToPage21";
68 case RequestTLVPAndTransformToPageOffset12
:
69 return "RequestTLVPAndTransformToPageOffset12";
70 case RequestTLSDescEntryAndTransformToPage21
:
71 return "RequestTLSDescEntryAndTransformToPage21";
72 case RequestTLSDescEntryAndTransformToPageOffset12
:
73 return "RequestTLSDescEntryAndTransformToPageOffset12";
75 return getGenericEdgeKindName(static_cast<Edge::Kind
>(R
));
79 } // namespace aarch64
80 } // namespace jitlink