Files
TheRock/compiler/amd-llvm/llvm/test/MC/Mips/cpsetup.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

226 lines
5.2 KiB
ArmAsm

# RUN: llvm-mc -triple mips-unknown-linux -target-abi o32 -filetype=obj -o - %s | \
# RUN: llvm-objdump --no-print-imm-hex -d -r -z - | FileCheck --check-prefixes=ALL,O32 %s
# RUN: llvm-mc -triple mips-unknown-linux -target-abi o32 %s | \
# RUN: FileCheck -check-prefixes=ASM,ASM-O32 %s
# RUN: llvm-mc -triple mips64-unknown-linux -target-abi n32 -filetype=obj -o - %s | \
# RUN: llvm-objdump --no-print-imm-hex -d -r -z - | \
# RUN: FileCheck -check-prefixes=ALL,NXX,N32 %s
# RUN: llvm-mc -triple mips64-unknown-linux -target-abi n32 %s | \
# RUN: FileCheck -check-prefixes=ASM,ASM-N32 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s -filetype=obj -o - | \
# RUN: llvm-objdump --no-print-imm-hex -d -r -z - | \
# RUN: FileCheck -check-prefixes=ALL,NXX,N64 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s | \
# RUN: FileCheck -check-prefixes=ASM,ASM-N64 %s
.text
.option pic2
t1:
.cpsetup $25, 8, __cerror
nop
.cpreturn
nop
# ALL-LABEL: <t1>:
# ASM-LABEL: t1:
# O32-NOT: __cerror
# NXX-NEXT: sd $gp, 8($sp)
# NXX-NEXT: lui $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_HI16
# NXX-NEXT: addiu $gp, $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_LO16
# N32-NEXT: addu $gp, $gp, $25
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ALL-NEXT: nop
# ASM: .cpreturn
# NXX-NEXT: ld $gp, 8($sp)
# ALL-NEXT: nop
t2:
.cpsetup $25, $2, __cerror
nop
.cpreturn
nop
# ALL-LABEL: <t2>:
# ASM-LABEL: t2:
# O32-NOT: __cerror
# NXX-NEXT: move $2, $gp
# NXX-NEXT: lui $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_HI16
# NXX-NEXT: addiu $gp, $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_LO16
# N32-NEXT: addu $gp, $gp, $25
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, $2, __cerror
# ALL-NEXT: nop
# ASM: .cpreturn
# NXX-NEXT: move $gp, $2
# ALL-NEXT: nop
# .cpsetup with local labels (PR22518):
# The '1:' label isn't emitted in all cases but we still want a label to match
# so we force one here.
t3:
nop
1:
.cpsetup $25, $2, 1b
nop
sub $3, $3, $2
# ALL-LABEL: <t3>:
# ASM-LABEL: t3:
# ALL-NEXT: nop
# O32-NEXT: nop
# O32-NEXT: sub $3, $3, $2
# NXX-NEXT: move $2, $gp
# NXX-NEXT: lui $gp, 0
# N64-NEXT: {{^ *0+}}40: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 .text
# N32-NEXT: {{^ *0+}}40: R_MIPS_GPREL16 .text
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_HI16
# NXX-NEXT: addiu $gp, $gp, 0
# N64-NEXT: {{^ *0+}}44: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 .text
# N32-NEXT: {{^ *0+}}44: R_MIPS_GPREL16 .text
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_LO16
# N32-NEXT: addu $gp, $gp, $25
# N64-NEXT: daddu $gp, $gp, $25
# NXX-NEXT: nop
# NXX-NEXT: sub $3, $3, $2
# ASM-O32: [[LABEL:\$tmp0]]:
# ASM-N32: [[LABEL:\.Ltmp0]]:
# ASM-N64: [[LABEL:\.Ltmp0]]:
# ASM-NEXT: .cpsetup $25, $2, [[LABEL]]
# Ensure we have at least one instruction between labels so that the labels
# we're matching aren't removed.
nop
# ALL-NEXT: nop
.option pic0
t4:
nop
.cpsetup $25, 8, __cerror
nop
.cpreturn
nop
# Testing that .cpsetup expands to nothing in this case
# by checking that the next instruction after the first
# nop is also a 'nop'.
# ALL-LABEL: <t4>:
# ASM-LABEL: t4:
# NXX-NEXT: nop
# NXX-NEXT: nop
# NXX-NEXT: nop
# ASM-NEXT: nop
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ASM-NEXT: nop
# ASM-NEXT: .cpreturn
# ASM-NEXT: nop
# Test that we accept constant expressions.
.option pic2
t5:
.cpsetup $25, ((8*4) - (3*8)), __cerror
nop
# ALL-LABEL: <t5>:
# ASM-LABEL: t5:
# O32-NOT: __cerror
# NXX-NEXT: sd $gp, 8($sp)
# NXX-NEXT: lui $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_HI16
# NXX-NEXT: addiu $gp, $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_LO16
# N32-NEXT: addu $gp, $gp, $25
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ALL-NEXT: nop
t1b:
IMM_8 = 8
.cpsetup $25, IMM_8, __cerror
nop
.cpreturn
nop
# ALL-LABEL: <t1b>:
# ASM-LABEL: t1b:
# ASM-NEXT: IMM_8 = 8
# O32-NOT: __cerror
# NXX-NEXT: sd $gp, 8($sp)
# NXX-NEXT: lui $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_HI16
# NXX-NEXT: addiu $gp, $gp, 0
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N32-NEXT: R_MIPS_GPREL16 __cerror
# N32-NEXT: R_MIPS_SUB
# N32-NEXT: R_MIPS_LO16
# N32-NEXT: addu $gp, $gp, $25
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ALL-NEXT: nop
# ASM: .cpreturn
# NXX-NEXT: ld $gp, 8($sp)
# ALL-NEXT: nop