Files
TheRock/compiler/amd-llvm/compiler-rt/lib/xray/xray_trampoline_riscv_common.S
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

97 lines
2.4 KiB
ArmAsm

//===-- xray_trampoline_riscv_common.s --------------------------*- ASM -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file is a part of XRay, a dynamic runtime instrumentation system.
//
// This implements the trampolines code shared between riscv32 and riscv64.
//
//===----------------------------------------------------------------------===//
#include "../builtins/assembly.h"
.text
.p2align 2
.global ASM_SYMBOL(__xray_FunctionEntry)
ASM_TYPE_FUNCTION(__xray_FunctionEntry)
ASM_SYMBOL(__xray_FunctionEntry):
CFI_STARTPROC
SAVE_ARG_REGISTERS
// Load the handler function pointer into a2
la a2, ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)
LOAD_XLEN a2, 0(a2)
// Handler address will be null if it is not set
beq a2, x0, 1f
// If we reach here, we are tracing an event
// a0 already contains function id
// a1 = 0 means we are tracing an entry event
li a1, 0
jalr a2
1:
RESTORE_ARG_REGISTERS
jr ra
ASM_SIZE(__xray_FunctionEntry)
CFI_ENDPROC
.text
.p2align 2
.global ASM_SYMBOL(__xray_FunctionExit)
ASM_TYPE_FUNCTION(__xray_FunctionExit)
ASM_SYMBOL(__xray_FunctionExit):
CFI_STARTPROC
SAVE_RET_REGISTERS
// Load the handler function pointer into a2
la a2, ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)
LOAD_XLEN a2, 0(a2)
// Handler address will be null if it is not set
beq a2, x0, 1f
// If we reach here, we are tracing an event
// a0 already contains function id
// a1 = 1 means we are tracing an exit event
li a1, 1
jalr a2
1:
RESTORE_RET_REGISTERS
jr ra
ASM_SIZE(__xray_FunctionExit)
CFI_ENDPROC
.text
.p2align 2
.global ASM_SYMBOL(__xray_FunctionTailExit)
ASM_TYPE_FUNCTION(__xray_FunctionTailExit)
ASM_SYMBOL(__xray_FunctionTailExit):
CFI_STARTPROC
SAVE_ARG_REGISTERS
// Load the handler function pointer into a2
la a2, ASM_SYMBOL(_ZN6__xray19XRayPatchedFunctionE)
LOAD_XLEN a2, 0(a2)
// Handler address will be null if it is not set
beq a2, x0, 1f
// If we reach here, we are tracing an event
// a0 already contains function id
// a1 = 2 means we are tracing a tail exit event
li a1, 2
jalr a2
1:
RESTORE_ARG_REGISTERS
jr ra
ASM_SIZE(__xray_FunctionTailExit)
CFI_ENDPROC