Files
TheRock/compiler/amd-llvm/llvm/test/MC/LoongArch/Basic/Integer/bit-shift.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

89 lines
2.7 KiB
ArmAsm

## Test valid bit shift instructions.
# RUN: llvm-mc %s --triple=loongarch32 --show-encoding \
# RUN: | FileCheck --check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
# RUN: llvm-mc %s --triple=loongarch64 --show-encoding --defsym=LA64=1 \
# RUN: | FileCheck --check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ,CHECK64-ASM,CHECK64-ASM-AND-OBJ %s
# RUN: llvm-mc %s --triple=loongarch32 --filetype=obj | llvm-objdump -d - \
# RUN: | FileCheck --check-prefixes=CHECK-ASM-AND-OBJ %s
# RUN: llvm-mc %s --triple=loongarch64 --filetype=obj --defsym=LA64=1 | llvm-objdump -d - \
# RUN: | FileCheck --check-prefixes=CHECK-ASM-AND-OBJ,CHECK64-ASM-AND-OBJ %s
#############################################################
## Instructions for both loongarch32 and loongarch64
#############################################################
# CHECK-ASM-AND-OBJ: sll.w $s1, $s4, $s0
# CHECK-ASM: encoding: [0x78,0x5f,0x17,0x00]
sll.w $s1, $s4, $s0
# CHECK-ASM-AND-OBJ: srl.w $s8, $t5, $a3
# CHECK-ASM: encoding: [0x3f,0x9e,0x17,0x00]
srl.w $s8, $t5, $a3
# CHECK-ASM-AND-OBJ: sra.w $t0, $s5, $a6
# CHECK-ASM: encoding: [0x8c,0x2b,0x18,0x00]
sra.w $t0, $s5, $a6
# CHECK-ASM-AND-OBJ: rotr.w $ra, $s3, $t6
# CHECK-ASM: encoding: [0x41,0x4b,0x1b,0x00]
rotr.w $ra, $s3, $t6
# CHECK-ASM-AND-OBJ: slli.w $s3, $t6, 0
# CHECK-ASM: encoding: [0x5a,0x82,0x40,0x00]
slli.w $s3, $t6, 0
# CHECK-ASM-AND-OBJ: srli.w $a6, $t2, 30
# CHECK-ASM: encoding: [0xca,0xf9,0x44,0x00]
srli.w $a6, $t2, 30
# CHECK-ASM-AND-OBJ: srai.w $a4, $t5, 24
# CHECK-ASM: encoding: [0x28,0xe2,0x48,0x00]
srai.w $a4, $t5, 24
# CHECK-ASM-AND-OBJ: rotri.w $s0, $t8, 23
# CHECK-ASM: encoding: [0x97,0xde,0x4c,0x00]
rotri.w $s0, $t8, 23
#############################################################
## Instructions only for loongarch64
#############################################################
.ifdef LA64
# CHECK64-ASM-AND-OBJ: sll.d $t8, $t3, $sp
# CHECK64-ASM: encoding: [0xf4,0x8d,0x18,0x00]
sll.d $t8, $t3, $sp
# CHECK64-ASM-AND-OBJ: srl.d $t2, $s2, $zero
# CHECK64-ASM: encoding: [0x2e,0x03,0x19,0x00]
srl.d $t2, $s2, $zero
# CHECK64-ASM-AND-OBJ: sra.d $a3, $fp, $s8
# CHECK64-ASM: encoding: [0xc7,0xfe,0x19,0x00]
sra.d $a3, $fp, $s8
# CHECK64-ASM-AND-OBJ: rotr.d $s8, $sp, $ra
# CHECK64-ASM: encoding: [0x7f,0x84,0x1b,0x00]
rotr.d $s8, $sp, $ra
# CHECK64-ASM-AND-OBJ: slli.d $a6, $s8, 39
# CHECK64-ASM: encoding: [0xea,0x9f,0x41,0x00]
slli.d $a6, $s8, 39
# CHECK64-ASM-AND-OBJ: srli.d $s8, $fp, 38
# CHECK64-ASM: encoding: [0xdf,0x9a,0x45,0x00]
srli.d $s8, $fp, 38
# CHECK64-ASM-AND-OBJ: srai.d $a5, $r21, 27
# CHECK64-ASM: encoding: [0xa9,0x6e,0x49,0x00]
srai.d $a5, $r21, 27
# CHECK64-ASM-AND-OBJ: rotri.d $s6, $zero, 7
# CHECK64-ASM: encoding: [0x1d,0x1c,0x4d,0x00]
rotri.d $s6, $zero, 7
.endif