Files
TheRock/compiler/amd-llvm/llvm/test/MC/RISCV/mapping-isa-option-rv32.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

76 lines
2.5 KiB
ArmAsm

## Test ISA mapping symbol emission for .option rvc/norvc/arch/push/pop on rv32.
## The assembler emits a "$x<ISAString>" symbol when the active ISA changes,
## using lazy emission (the symbol appears before the first instruction after
## the change) and deduplication (no symbol when the ISA is unchanged).
## An initial "$x<ISAString>" symbol is also emitted before the very first
## instruction to record the starting ISA in the object file.
# RUN: llvm-mc -triple=riscv32 -mattr=+f,+a -filetype=obj -o %t.o %s
# RUN: llvm-readobj --symbols %t.o | FileCheck %s
.text
nop
# The initial ISA mapping symbol is emitted before the first instruction.
# CHECK: Name: $xrv32i2p1_a2p1_f2p2_zicsr2p0_zaamo1p0_zalrsc1p0
# CHECK-NEXT: Value: 0x0
# .option rvc enables C; a new symbol is emitted before the next instruction.
.option rvc
nop
# CHECK: Name: $xrv32i2p1_a2p1_f2p2_c2p0_zicsr2p0_zaamo1p0_zalrsc1p0_zca1p0_zcf1p0
# CHECK-NEXT: Value: 0x4
# .option norvc disables C; a new symbol without C is emitted.
.option norvc
nop
# CHECK: Name: $xrv32i2p1_a2p1_f2p2_zicsr2p0_zaamo1p0_zalrsc1p0
# CHECK-NEXT: Value: 0x6
# .option push saves the current ISA; .option arch switches to a full ISA;
# .option pop restores the pre-push ISA and emits a new symbol for it.
.option push
.option arch, rv32imac
nop
# CHECK: Name: $xrv32i2p1_m2p0_a2p1_c2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0
# CHECK-NEXT: Value: 0xA
.option pop
nop
# CHECK: Name: $xrv32i2p1_a2p1_f2p2_zicsr2p0_zaamo1p0_zalrsc1p0
# CHECK-NEXT: Value: 0xC
# Deduplication: repeating the same .option arch does not emit a second symbol.
.option arch, rv32imac
nop
# CHECK: Name: $xrv32i2p1_m2p0_a2p1_c2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0
# CHECK-NEXT: Value: 0x10
.option arch, rv32imac
nop
# No additional symbol expected between the two instructions above.
# CHECK-NOT: $xrv32i2p1_m2p0_a2p1_c2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0 {{.*}}Value: 0x1[^0]
# Nested push/pop: walk down to an inner ISA via two pushes with distinct
# .option arch in between, then walk back up with two pops. Each level must
# emit its own mapping symbol so the stack is observable in the object.
.option push
.option arch, rv32im
nop
# CHECK: Name: $xrv32i2p1_m2p0_zmmul1p0
# CHECK-NEXT: Value: 0x14
.option push
.option arch, rv32imc
nop
# CHECK: Name: $xrv32i2p1_m2p0_c2p0_zmmul1p0_zca1p0
# CHECK-NEXT: Value: 0x18
.option pop
nop
# CHECK: Name: $xrv32i2p1_m2p0_zmmul1p0
# CHECK-NEXT: Value: 0x1A
.option pop
nop
# CHECK: Name: $xrv32i2p1_m2p0_a2p1_c2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0
# CHECK-NEXT: Value: 0x1E