Files
TheRock/compiler/amd-llvm/llvm/test/MC/ARM/thumb-add-sub-width.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

71 lines
2.8 KiB
ArmAsm

// RUN: llvm-mc -triple thumbv6m -show-encoding < %s | FileCheck %s
.text
.thumb
// Check that the correct encoding of the add and sub instructions is
// selected, for all combinations of flag-setting, condition and 2- or
// 3-operand syntax.
.arch armv6-m
add r0, r0, r1 // T2
add r0, r1 // T2
adds r0, r0, r1 // T1
adds r0, r1 // T1
// CHECK: add r0, r1 @ encoding: [0x08,0x44]
// CHECK: add r0, r1 @ encoding: [0x08,0x44]
// CHECK: adds r0, r0, r1 @ encoding: [0x40,0x18]
// CHECK: adds r0, r0, r1 @ encoding: [0x40,0x18]
.arch armv7-m
add r0, r0, r1 // T2, T3
add r0, r1 // T2, T3
adds r0, r0, r1 // T1, T3
adds r0, r1 // T1, T3
// CHECK: add r0, r1 @ encoding: [0x08,0x44]
// CHECK: add r0, r1 @ encoding: [0x08,0x44]
// CHECK: adds r0, r0, r1 @ encoding: [0x40,0x18]
// CHECK: adds r0, r0, r1 @ encoding: [0x40,0x18]
itttt eq
// CHECK: itttt eq @ encoding: [0x01,0xbf]
addeq r0, r0, r1 // T1, T2, T3
addeq r0, r1 // T2, T1, T3
addseq r0, r0, r1 // T3
addseq r0, r1 // T3
// NOTE: Both T1 and T2 are valid for these two instructions, which one is
// the preferred varies depending on whether the 2- or 3-operand syntax was
// used.
// CHECK: addeq r0, r0, r1 @ encoding: [0x40,0x18]
// CHECK: addeq r0, r1 @ encoding: [0x08,0x44]
// CHECK: addseq.w r0, r0, r1 @ encoding: [0x10,0xeb,0x01,0x00]
// CHECK: addseq.w r0, r0, r1 @ encoding: [0x10,0xeb,0x01,0x00]
.arch armv6-m
// NOTE: There is no non-flag-setting sub instruction for v6-M
subs r0, r0, r1 // T1, T2
subs r0, r1 // T1, T2
// CHECK: subs r0, r0, r1 @ encoding: [0x40,0x1a]
// CHECK: subs r0, r0, r1 @ encoding: [0x40,0x1a]
.arch armv7-m
sub r0, r0, r1 // T2
sub r0, r1 // T2
subs r0, r0, r1 // T1, T2
subs r0, r1 // T1, T2
// CHECK: sub.w r0, r0, r1 @ encoding: [0xa0,0xeb,0x01,0x00]
// CHECK: sub.w r0, r0, r1 @ encoding: [0xa0,0xeb,0x01,0x00]
// CHECK: subs r0, r0, r1 @ encoding: [0x40,0x1a]
// CHECK: subs r0, r0, r1 @ encoding: [0x40,0x1a]
itttt eq
// CHECK: itttt eq @ encoding: [0x01,0xbf]
subeq r0, r0, r1 // T1, T2
subeq r0, r1 // T1, T2
subseq r0, r0, r1 // T2
subseq r0, r1 // T2
// CHECK: subeq r0, r0, r1 @ encoding: [0x40,0x1a]
// CHECK: subeq r0, r0, r1 @ encoding: [0x40,0x1a]
// CHECK: subseq.w r0, r0, r1 @ encoding: [0xb0,0xeb,0x01,0x00]
// CHECK: subseq.w r0, r0, r1 @ encoding: [0xb0,0xeb,0x01,0x00]