Files
TheRock/compiler/amd-llvm/llvm/test/MC/LoongArch/Macros/aliases-la.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

127 lines
5.1 KiB
ArmAsm

## Test la/la.global/la.local expand to different instructions sequence under
## different features.
# RUN: llvm-mc --triple=loongarch64 %s \
# RUN: | FileCheck %s --check-prefix=NORMAL
# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=-relax %s -o %t
# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+relax %s -o %t.relax
# RUN: llvm-readobj -r %t.relax | FileCheck %s --check-prefixes=RELOC,RELAX
# RUN: llvm-mc --triple=loongarch64 --mattr=+la-global-with-pcrel < %s \
# RUN: | FileCheck %s --check-prefix=GTOPCR
# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+la-global-with-pcrel \
# RUN: --mattr=-relax %s -o %t
# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=GTOPCR-RELOC
# RUN: llvm-mc --filetype=obj --triple=loongarch64 --mattr=+la-global-with-pcrel \
# RUN: --mattr=+relax %s -o %t.relax
# RUN: llvm-readobj -r %t.relax | FileCheck %s --check-prefixes=GTOPCR-RELOC,GTOPCR-RELAX
# RUN: llvm-mc --triple=loongarch64 --mattr=+la-global-with-abs < %s \
# RUN: | FileCheck %s --check-prefix=GTOABS
# RUN: llvm-mc --triple=loongarch64 --mattr=+la-local-with-abs < %s \
# RUN: | FileCheck %s --check-prefix=LTOABS
# RELOC: Relocations [
# RELOC-NEXT: Section ({{.*}}) .rela.text {
la $a0, sym
# NORMAL: pcalau12i $a0, %got_pc_hi20(sym)
# NORMAL-NEXT: ld.d $a0, $a0, %got_pc_lo12(sym)
# GTOPCR: pcalau12i $a0, %pc_hi20(sym)
# GTOPCR-NEXT: addi.d $a0, $a0, %pc_lo12(sym)
# GTOABS: lu12i.w $a0, %abs_hi20(sym)
# GTOABS-NEXT: ori $a0, $a0, %abs_lo12(sym)
# GTOABS-NEXT: lu32i.d $a0, %abs64_lo20(sym)
# GTOABS-NEXT: lu52i.d $a0, $a0, %abs64_hi12(sym)
# RELOC-NEXT: R_LARCH_GOT_PC_HI20 sym 0x0
# RELAX-NEXT: R_LARCH_RELAX - 0x0
# RELOC-NEXT: R_LARCH_GOT_PC_LO12 sym 0x0
# RELAX-NEXT: R_LARCH_RELAX - 0x0
# GTOPCR-RELOC: R_LARCH_PCALA_HI20 sym 0x0
# GTOPCR-RELAX: R_LARCH_RELAX - 0x0
# GTOPCR-RELOC-NEXT: R_LARCH_PCALA_LO12 sym 0x0
# GTOPCR-RELAX-NEXT: R_LARCH_RELAX - 0x0
la.global $a0, sym_global
# NORMAL: pcalau12i $a0, %got_pc_hi20(sym_global)
# NORMAL-NEXT: ld.d $a0, $a0, %got_pc_lo12(sym_global)
# GTOPCR: pcalau12i $a0, %pc_hi20(sym_global)
# GTOPCR-NEXT: addi.d $a0, $a0, %pc_lo12(sym_global)
# GTOABS: lu12i.w $a0, %abs_hi20(sym_global)
# GTOABS-NEXT: ori $a0, $a0, %abs_lo12(sym_global)
# GTOABS-NEXT: lu32i.d $a0, %abs64_lo20(sym_global)
# GTOABS-NEXT: lu52i.d $a0, $a0, %abs64_hi12(sym_global)
# RELOC-NEXT: R_LARCH_GOT_PC_HI20 sym_global 0x0
# RELAX-NEXT: R_LARCH_RELAX - 0x0
# RELOC-NEXT: R_LARCH_GOT_PC_LO12 sym_global 0x0
# RELAX-NEXT: R_LARCH_RELAX - 0x0
# GTOPCR-RELOC-NEXT: R_LARCH_PCALA_HI20 sym_global 0x0
# GTOPCR-RELAX-NEXT: R_LARCH_RELAX - 0x0
# GTOPCR-RELOC-NEXT: R_LARCH_PCALA_LO12 sym_global 0x0
# GTOPCR-RELAX-NEXT: R_LARCH_RELAX - 0x0
la.global $a0, $a1, sym_global_large
# NORMAL: pcalau12i $a0, %got_pc_hi20(sym_global_large)
# NORMAL-NEXT: addi.d $a1, $zero, %got_pc_lo12(sym_global_large)
# NORMAL-NEXT: lu32i.d $a1, %got64_pc_lo20(sym_global_large)
# NORMAL-NEXT: lu52i.d $a1, $a1, %got64_pc_hi12(sym_global_large)
# NORMAL-NEXT: ldx.d $a0, $a0, $a1
# GTOPCR: pcalau12i $a0, %pc_hi20(sym_global_large)
# GTOPCR-NEXT: addi.d $a1, $zero, %pc_lo12(sym_global_large)
# GTOPCR-NEXT: lu32i.d $a1, %pc64_lo20(sym_global_large)
# GTOPCR-NEXT: lu52i.d $a1, $a1, %pc64_hi12(sym_global_large)
# GTOPCR-NEXT: add.d $a0, $a0, $a1
# GTOABS: lu12i.w $a0, %abs_hi20(sym_global_large)
# GTOABS-NEXT: ori $a0, $a0, %abs_lo12(sym_global_large)
# GTOABS-NEXT: lu32i.d $a0, %abs64_lo20(sym_global_large)
# GTOABS-NEXT: lu52i.d $a0, $a0, %abs64_hi12(sym_global_large)
# RELOC-NEXT: R_LARCH_GOT_PC_HI20 sym_global_large 0x0
# RELOC-NEXT: R_LARCH_GOT_PC_LO12 sym_global_large 0x0
# RELOC-NEXT: R_LARCH_GOT64_PC_LO20 sym_global_large 0x0
# RELOC-NEXT: R_LARCH_GOT64_PC_HI12 sym_global_large 0x0
la.local $a0, sym_local
# NORMAL: pcalau12i $a0, %pc_hi20(sym_local)
# NORMAL-NEXT: addi.d $a0, $a0, %pc_lo12(sym_local)
# LTOABS: lu12i.w $a0, %abs_hi20(sym_local)
# LTOABS-NEXT: ori $a0, $a0, %abs_lo12(sym_local)
# LTOABS-NEXT: lu32i.d $a0, %abs64_lo20(sym_local)
# LTOABS-NEXT: lu52i.d $a0, $a0, %abs64_hi12(sym_local)
# RELOC-NEXT: R_LARCH_PCALA_HI20 sym_local 0x0
# RELAX-NEXT: R_LARCH_RELAX - 0x0
# RELOC-NEXT: R_LARCH_PCALA_LO12 sym_local 0x0
# RELAX-NEXT: R_LARCH_RELAX - 0x0
la.local $a0, $a1, sym_local_large
# NORMAL: pcalau12i $a0, %pc_hi20(sym_local_large)
# NORMAL-NEXT: addi.d $a1, $zero, %pc_lo12(sym_local_large)
# NORMAL-NEXT: lu32i.d $a1, %pc64_lo20(sym_local_large)
# NORMAL-NEXT: lu52i.d $a1, $a1, %pc64_hi12(sym_local_large)
# NORMAL-NEXT: add.d $a0, $a0, $a1
# LTOABS: lu12i.w $a0, %abs_hi20(sym_local_large)
# LTOABS-NEXT: ori $a0, $a0, %abs_lo12(sym_local_large)
# LTOABS-NEXT: lu32i.d $a0, %abs64_lo20(sym_local_large)
# LTOABS-NEXT: lu52i.d $a0, $a0, %abs64_hi12(sym_local_large)
# RELOC-NEXT: R_LARCH_PCALA_HI20 sym_local_large 0x0
# RELOC-NEXT: R_LARCH_PCALA_LO12 sym_local_large 0x0
# RELOC-NEXT: R_LARCH_PCALA64_LO20 sym_local_large 0x0
# RELOC-NEXT: R_LARCH_PCALA64_HI12 sym_local_large 0x0
# RELOC-NEXT: }
# RELOC-NEXT: ]