Files
TheRock/compiler/amd-llvm/llvm/test/MC/AArch64/label-arithmetic-elf.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

99 lines
2.1 KiB
ArmAsm

// RUN: llvm-mc -triple aarch64-elf -filetype=obj %s -o - | llvm-objdump --no-print-imm-hex -d - | FileCheck %s
start:
.space 8
end:
// CHECK-LABEL: <end>:
adds w0, w1, #(end - start)
adds x0, x1, #(end - start)
add w0, w1, #(end - start)
add x0, x1, #(end - start)
cmp w0, #(end - start)
cmp x0, #(end - start)
sub w0, w1, #(end - start)
sub x0, x1, #(end - start)
// FIXME: adr x1, #(end - start) // This could be supported, but currently doesn't work
// CHECK: adds w0, w1, #8
// CHECK: adds x0, x1, #8
// CHECK: add w0, w1, #8
// CHECK: add x0, x1, #8
// CHECK: cmp w0, #8
// CHECK: cmp x0, #8
// CHECK: sub w0, w1, #8
// CHECK: sub x0, x1, #8
// FIXME: adr x1, #8
add w0, w1, #(end - start), lsl #12
cmp w0, #(end - start), lsl #12
// CHECK: add w0, w1, #8, lsl #12
// CHECK: cmp w0, #8, lsl #12
add w0, w1, #((end - start) >> 2)
cmp w0, #((end - start) >> 2)
// CHECK: add w0, w1, #2
// CHECK: cmp w0, #2
add w0, w1, #(end - start + 12)
cmp w0, #(end - start + 12)
// CHECK: add w0, w1, #20
// CHECK: cmp w0, #20
add w0, w1, #(forward - end)
cmp w0, #(forward - end)
// CHECK: add w0, w1, #320
// CHECK: cmp w0, #320
// Add some filler so we don't have to modify #(forward - end) if we add more
// instructions above
.Lfiller:
.space 320 - (.Lfiller - end)
forward:
.space 8
.Lstart:
.space 8
.Lend:
add w0, w1, #(.Lend - .Lstart)
cmp w0, #(.Lend - .Lstart)
// CHECK: add w0, w1, #8
// CHECK: cmp w0, #8
.Lprivate1:
.space 8
notprivate:
.space 8
.Lprivate2:
add w0, w1, #(.Lprivate2 - .Lprivate1)
cmp w0, #(.Lprivate2 - .Lprivate1)
// CHECK: add w0, w1, #16
// CHECK: cmp w0, #16
.type foo, @function
foo:
// CHECK-LABEL: <foo>:
add w0, w1, #(foo - .Lprivate2)
cmp w0, #(foo - .Lprivate2)
// CHECK: add w0, w1, #8
// CHECK: cmp w0, #8
ret
.type goo, @function
goo:
// CHECK-LABEL: <goo>:
add w0, w1, #(goo - foo)
cmp w0, #(goo - foo)
// CHECK: add w0, w1, #12
// CHECK: cmp w0, #12
add w0, w1, #(. - goo)
cmp w0, #(. - goo)
// CHECK: add w0, w1, #8
// CHECK: cmp w0, #12
ret