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

106 lines
3.8 KiB
ArmAsm

#include "../builtins/assembly.h"
.syntax unified
.arch armv6t2
.fpu vfpv2
.code 32
.global _ZN6__xray19XRayPatchedFunctionE
@ Word-aligned function entry point
.p2align 2
@ Let C/C++ see the symbol
.global __xray_FunctionEntry
.hidden __xray_FunctionEntry
@ It preserves all registers except r0, r12(ip), r14(lr) and r15(pc)
@ Assume that "q" part of the floating-point registers is not used
@ for passing parameters to C/C++ functions.
.type __xray_FunctionEntry, %function
@ In C++ it is void extern "C" __xray_FunctionEntry(uint32_t FuncId) with
@ FuncId passed in r0 register.
__xray_FunctionEntry:
PUSH {r1-r3,lr}
@ Save floating-point parameters of the instrumented function
VPUSH {d0-d7}
MOVW r1, #:lower16:_ZN6__xray19XRayPatchedFunctionE - (. + 16)
MOVT r1, #:upper16:_ZN6__xray19XRayPatchedFunctionE - (. + 12)
LDR r2, [pc, r1]
@ Handler address is nullptr if handler is not set
CMP r2, #0
BEQ FunctionEntry_restore
@ Function ID is already in r0 (the first parameter).
@ r1=0 means that we are tracing an entry event
MOV r1, #0
@ Call the handler with 2 parameters in r0 and r1
BLX r2
FunctionEntry_restore:
@ Restore floating-point parameters of the instrumented function
VPOP {d0-d7}
POP {r1-r3,pc}
@ Word-aligned function entry point
.p2align 2
@ Let C/C++ see the symbol
.global __xray_FunctionExit
.hidden __xray_FunctionExit
@ Assume that d1-d7 are not used for the return value.
@ Assume that "q" part of the floating-point registers is not used for the
@ return value in C/C++.
.type __xray_FunctionExit, %function
@ In C++ it is extern "C" void __xray_FunctionExit(uint32_t FuncId) with
@ FuncId passed in r0 register.
__xray_FunctionExit:
PUSH {r1-r3,lr}
@ Save the floating-point return value of the instrumented function
VPUSH {d0}
@ Load the handler address
MOVW r1, #:lower16:_ZN6__xray19XRayPatchedFunctionE - (. + 16)
MOVT r1, #:upper16:_ZN6__xray19XRayPatchedFunctionE - (. + 12)
LDR r2, [pc, r1]
@ Handler address is nullptr if handler is not set
CMP r2, #0
BEQ FunctionExit_restore
@ Function ID is already in r0 (the first parameter).
@ 1 means that we are tracing an exit event
MOV r1, #1
@ Call the handler with 2 parameters in r0 and r1
BLX r2
FunctionExit_restore:
@ Restore the floating-point return value of the instrumented function
VPOP {d0}
POP {r1-r3,pc}
@ Word-aligned function entry point
.p2align 2
@ Let C/C++ see the symbol
.global __xray_FunctionTailExit
.hidden __xray_FunctionTailExit
@ It preserves all registers except r0, r12(ip), r14(lr) and r15(pc)
@ Assume that "q" part of the floating-point registers is not used
@ for passing parameters to C/C++ functions.
.type __xray_FunctionTailExit, %function
@ In C++ it is void extern "C" __xray_FunctionTailExit(uint32_t FuncId)
@ with FuncId passed in r0 register.
__xray_FunctionTailExit:
PUSH {r1-r3,lr}
@ Save floating-point parameters of the instrumented function
VPUSH {d0-d7}
MOVW r1, #:lower16:_ZN6__xray19XRayPatchedFunctionE - (. + 16)
MOVT r1, #:upper16:_ZN6__xray19XRayPatchedFunctionE - (. + 12)
LDR r2, [pc, r1]
@ Handler address is nullptr if handler is not set
CMP r2, #0
BEQ FunctionTailExit_restore
@ Function ID is already in r0 (the first parameter).
@ r1=2 means that we are tracing a tail exit event
@ But before the logging part of XRay is ready, we pretend that here a
@ normal function exit happens, so we give the handler code 1
MOV r1, #1
@ Call the handler with 2 parameters in r0 and r1
BLX r2
FunctionTailExit_restore:
@ Restore floating-point parameters of the instrumented function
VPOP {d0-d7}
POP {r1-r3,pc}
NO_EXEC_STACK_DIRECTIVE