Files
TheRock/compiler/amd-llvm/llvm/lib/ExecutionEngine/JITLink/loongarch.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

81 lines
2.5 KiB
C++

//===--- loongarch.cpp - Generic JITLink loongarch edge kinds, utilities --===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Generic utilities for graphs representing loongarch objects.
//
//===----------------------------------------------------------------------===//
#include "llvm/ExecutionEngine/JITLink/loongarch.h"
#define DEBUG_TYPE "jitlink"
namespace llvm {
namespace jitlink {
namespace loongarch {
const char NullPointerContent[8] = {0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00};
const uint8_t LA64StubContent[StubEntrySize] = {
0x14, 0x00, 0x00, 0x1a, // pcalau12i $t8, %page20(imm)
0x94, 0x02, 0xc0, 0x28, // ld.d $t8, $t8, %pageoff12(imm)
0x80, 0x02, 0x00, 0x4c // jr $t8
};
const uint8_t LA32StubContent[StubEntrySize] = {
0x14, 0x00, 0x00, 0x1c, // pcaddu12i $t8, %pcadd20(imm)
0x94, 0x02, 0x80, 0x28, // ld.w $t8, $t8, %pcadd12(.Lpcadd_hi)
0x80, 0x02, 0x00, 0x4c // jr $t8
};
const char *getEdgeKindName(Edge::Kind K) {
#define KIND_NAME_CASE(K) \
case K: \
return #K;
switch (K) {
KIND_NAME_CASE(Pointer64)
KIND_NAME_CASE(Pointer32)
KIND_NAME_CASE(Delta32)
KIND_NAME_CASE(NegDelta32)
KIND_NAME_CASE(Delta64)
KIND_NAME_CASE(Branch16PCRel)
KIND_NAME_CASE(Branch21PCRel)
KIND_NAME_CASE(Branch26PCRel)
KIND_NAME_CASE(Page20)
KIND_NAME_CASE(PageOffset12)
KIND_NAME_CASE(PCAddHi20)
KIND_NAME_CASE(PCAddLo12)
KIND_NAME_CASE(RequestGOTAndTransformToPage20)
KIND_NAME_CASE(RequestGOTAndTransformToPageOffset12)
KIND_NAME_CASE(RequestGOTAndTransformToPCAddHi20)
KIND_NAME_CASE(Call30PCRel)
KIND_NAME_CASE(Call36PCRel)
KIND_NAME_CASE(Add6)
KIND_NAME_CASE(Add8)
KIND_NAME_CASE(Add16)
KIND_NAME_CASE(Add32)
KIND_NAME_CASE(Add64)
KIND_NAME_CASE(AddUleb128)
KIND_NAME_CASE(Sub6)
KIND_NAME_CASE(Sub8)
KIND_NAME_CASE(Sub16)
KIND_NAME_CASE(Sub32)
KIND_NAME_CASE(Sub64)
KIND_NAME_CASE(SubUleb128)
KIND_NAME_CASE(AlignRelaxable)
default:
return getGenericEdgeKindName(K);
}
#undef KIND_NAME_CASE
}
} // namespace loongarch
} // namespace jitlink
} // namespace llvm