Files
TheRock/compiler/amd-llvm/compiler-rt/lib/builtins/arm/aeabi_uread8.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

101 lines
2.9 KiB
ArmAsm

//===-- aeabi_uread8.S - ARM EABI Helper — Unaligned 8-Byte Memory Read----===//
//
// 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
//
// Implements __aeabi_uread8 for unaligned memory accesses.
// Reference: Arm RTABI32 Specification.
// https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#unaligned-memory-access
//===-------------------------------------------------------------------------------------===//
#include "../assembly.h"
.syntax unified
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__aeabi_uread8)
#if defined(__thumb__) && !defined(__thumb2__)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
ldrb r1, [r0]
ldrb r2, [r0, #1]
lsls r2, r2, #8
adds r1, r2, r1
ldrb r2, [r0, #2]
lsls r2, r2, #16
ldrb r3, [r0, #3]
lsls r3, r3, #24
adds r2, r3, r2
adds r2, r2, r1
ldrb r1, [r0, #4]
ldrb r3, [r0, #5]
lsls r3, r3, #8
adds r1, r3, r1
ldrb r3, [r0, #6]
lsls r3, r3, #16
ldrb r0, [r0, #7]
lsls r0, r0, #24
adds r0, r0, r3
adds r1, r0, r1
#else
ldrb r1, [r0, #3]
ldrb r2, [r0, #2]
lsls r2, r2, #8
adds r1, r2, r1
ldrb r2, [r0, #1]
lsls r2, r2, #16
ldrb r3, [r0]
lsls r3, r3, #24
adds r2, r3, r2
adds r2, r2, r1
ldrb r1, [r0, #7]
ldrb r3, [r0, #6]
lsls r3, r3, #8
adds r1, r3, r1
ldrb r3, [r0, #5]
lsls r3, r3, #16
ldrb r0, [r0, #4]
lsls r0, r0, #24
adds r0, r0, r3
adds r1, r0, r1
#endif
mov r0, r2
bx lr
#else
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
ldrb r12, [r0]
ldrb r2, [r0, #1]
ldrb r3, [r0, #2]
ldrb r1, [r0, #3]
orr r1, r3, r1, lsl #8
orr r2, r12, r2, lsl #8
orr r2, r2, r1, lsl #16
ldrb r1, [r0, #5]
ldrb r3, [r0, #4]!
orr r1, r3, r1, lsl #8
ldrb r3, [r0, #2]
ldrb r0, [r0, #3]
orr r0, r3, r0, lsl #8
orr r1, r1, r0, lsl #16
#else
ldrb r12, [r0]
ldrb r2, [r0, #1]
ldrb r3, [r0, #2]
ldrb r1, [r0, #3]
orr r2, r2, r12, lsl #8
orr r1, r1, r3, lsl #8
orr r2, r1, r2, lsl #16
mov r1, r0
ldrb r0, [r0, #5]
ldrb r3, [r1, #4]!
orr r0, r0, r3, lsl #8
ldrb r3, [r1, #2]
ldrb r1, [r1, #3]
orr r1, r1, r3, lsl #8
orr r1, r1, r0, lsl #16
#endif
mov r0, r2
bx lr
#endif
END_COMPILERRT_FUNCTION(__aeabi_uread8)