Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/sve-st1-addressing-mode-reg-imm.ll
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

244 lines
7.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve,+disable-unpredicated-ld-st-lower < %s | FileCheck --check-prefixes=COMMON-NO-UPLS-LOWER,NO-UPLS-LOWER %s
; RUN: llc -mtriple=aarch64-linux-gnu -mcpu=a64fx < %s | FileCheck --check-prefixes=COMMON-NO-UPLS-LOWER,A64FX %s
; ST1B
define void @st1b_lower_bound(<vscale x 16 x i8> %data, ptr %a) {
; CHECK-LABEL: st1b_lower_bound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #-8, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1b_lower_bound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.b
; COMMON-NO-UPLS-LOWER-NEXT: st1b { z0.b }, p0, [x0, #-8, mul vl]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 16 x i8>, ptr %a, i64 -8
store <vscale x 16 x i8> %data, ptr %base
ret void
}
define void @st1b_inbound(<vscale x 16 x i8> %data, ptr %a) {
; CHECK-LABEL: st1b_inbound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #1, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1b_inbound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.b
; COMMON-NO-UPLS-LOWER-NEXT: st1b { z0.b }, p0, [x0, #1, mul vl]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 16 x i8>, ptr %a, i64 1
store <vscale x 16 x i8> %data, ptr %base
ret void
}
define void @st1b_upper_bound(<vscale x 16 x i8> %data, ptr %a) {
; CHECK-LABEL: st1b_upper_bound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #7, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1b_upper_bound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.b
; COMMON-NO-UPLS-LOWER-NEXT: st1b { z0.b }, p0, [x0, #7, mul vl]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 16 x i8>, ptr %a, i64 7
store <vscale x 16 x i8> %data, ptr %base
ret void
}
define void @st1b_out_of_upper_bound(<vscale x 16 x i8> %data, ptr %a) {
; CHECK-LABEL: st1b_out_of_upper_bound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #8, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1b_out_of_upper_bound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.b
; COMMON-NO-UPLS-LOWER-NEXT: rdvl x8, #8
; COMMON-NO-UPLS-LOWER-NEXT: st1b { z0.b }, p0, [x0, x8]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 16 x i8>, ptr %a, i64 8
store <vscale x 16 x i8> %data, ptr %base
ret void
}
define void @st1b_out_of_lower_bound(<vscale x 16 x i8> %data, ptr %a) {
; CHECK-LABEL: st1b_out_of_lower_bound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #-9, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1b_out_of_lower_bound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.b
; COMMON-NO-UPLS-LOWER-NEXT: rdvl x8, #-9
; COMMON-NO-UPLS-LOWER-NEXT: st1b { z0.b }, p0, [x0, x8]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 16 x i8>, ptr %a, i64 -9
store <vscale x 16 x i8> %data, ptr %base
ret void
}
; ST1H
define void @st1h_inbound(<vscale x 8 x i16> %data, ptr %a) {
; CHECK-LABEL: st1h_inbound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #-6, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1h_inbound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.h
; COMMON-NO-UPLS-LOWER-NEXT: st1h { z0.h }, p0, [x0, #-6, mul vl]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 8 x i16>, ptr %a, i64 -6
store <vscale x 8 x i16> %data, ptr %base
ret void
}
; ST1W
define void @st1w_inbound(<vscale x 4 x i32> %data, ptr %a) {
; CHECK-LABEL: st1w_inbound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #2, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1w_inbound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.s
; COMMON-NO-UPLS-LOWER-NEXT: st1w { z0.s }, p0, [x0, #2, mul vl]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 4 x i32>, ptr %a, i64 2
store <vscale x 4 x i32> %data, ptr %base
ret void
}
; ST1D
define void @st1d_inbound(<vscale x 2 x i64> %data, ptr %a) {
; CHECK-LABEL: st1d_inbound:
; CHECK: // %bb.0:
; CHECK-NEXT: str z0, [x0, #5, mul vl]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: st1d_inbound:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.d
; COMMON-NO-UPLS-LOWER-NEXT: st1d { z0.d }, p0, [x0, #5, mul vl]
; COMMON-NO-UPLS-LOWER-NEXT: ret
%base = getelementptr <vscale x 2 x i64>, ptr %a, i64 5
store <vscale x 2 x i64> %data, ptr %base
ret void
}
; Splat stores of unpacked FP scalable vectors
define void @store_nxv2f32(ptr %out) {
; CHECK-LABEL: store_nxv2f32:
; CHECK: // %bb.0:
; CHECK-NEXT: fmov z0.s, #1.00000000
; CHECK-NEXT: ptrue p0.d
; CHECK-NEXT: st1w { z0.d }, p0, [x0]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: store_nxv2f32:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: fmov z0.s, #1.00000000
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.d
; COMMON-NO-UPLS-LOWER-NEXT: st1w { z0.d }, p0, [x0]
; COMMON-NO-UPLS-LOWER-NEXT: ret
store <vscale x 2 x float> splat(float 1.0), ptr %out
ret void
}
define void @store_nxv4f16(ptr %out) {
; CHECK-LABEL: store_nxv4f16:
; CHECK: // %bb.0:
; CHECK-NEXT: fmov z0.h, #1.00000000
; CHECK-NEXT: ptrue p0.s
; CHECK-NEXT: st1h { z0.s }, p0, [x0]
; CHECK-NEXT: ret
;
; COMMON-NO-UPLS-LOWER-LABEL: store_nxv4f16:
; COMMON-NO-UPLS-LOWER: // %bb.0:
; COMMON-NO-UPLS-LOWER-NEXT: fmov z0.h, #1.00000000
; COMMON-NO-UPLS-LOWER-NEXT: ptrue p0.s
; COMMON-NO-UPLS-LOWER-NEXT: st1h { z0.s }, p0, [x0]
; COMMON-NO-UPLS-LOWER-NEXT: ret
store <vscale x 4 x half> splat(half 1.0), ptr %out
ret void
}
; Splat stores of unusual FP scalable vector types
define void @store_nxv6f32(ptr %out) {
; CHECK-LABEL: store_nxv6f32:
; CHECK: // %bb.0:
; CHECK-NEXT: fmov z0.s, #1.00000000
; CHECK-NEXT: ptrue p0.d
; CHECK-NEXT: st1w { z0.d }, p0, [x0, #2, mul vl]
; CHECK-NEXT: str z0, [x0]
; CHECK-NEXT: ret
;
; NO-UPLS-LOWER-LABEL: store_nxv6f32:
; NO-UPLS-LOWER: // %bb.0:
; NO-UPLS-LOWER-NEXT: fmov z0.s, #1.00000000
; NO-UPLS-LOWER-NEXT: ptrue p0.d
; NO-UPLS-LOWER-NEXT: ptrue p1.s
; NO-UPLS-LOWER-NEXT: st1w { z0.d }, p0, [x0, #2, mul vl]
; NO-UPLS-LOWER-NEXT: st1w { z0.s }, p1, [x0]
; NO-UPLS-LOWER-NEXT: ret
;
; A64FX-LABEL: store_nxv6f32:
; A64FX: // %bb.0:
; A64FX-NEXT: fmov z0.s, #1.00000000
; A64FX-NEXT: ptrue p0.d
; A64FX-NEXT: st1w { z0.d }, p0, [x0, #2, mul vl]
; A64FX-NEXT: ptrue p0.s
; A64FX-NEXT: st1w { z0.s }, p0, [x0]
; A64FX-NEXT: ret
store <vscale x 6 x float> splat(float 1.0), ptr %out
ret void
}
define void @store_nxv12f16(ptr %out) {
; CHECK-LABEL: store_nxv12f16:
; CHECK: // %bb.0:
; CHECK-NEXT: fmov z0.h, #1.00000000
; CHECK-NEXT: ptrue p0.s
; CHECK-NEXT: st1h { z0.s }, p0, [x0, #2, mul vl]
; CHECK-NEXT: str z0, [x0]
; CHECK-NEXT: ret
;
; NO-UPLS-LOWER-LABEL: store_nxv12f16:
; NO-UPLS-LOWER: // %bb.0:
; NO-UPLS-LOWER-NEXT: fmov z0.h, #1.00000000
; NO-UPLS-LOWER-NEXT: ptrue p0.s
; NO-UPLS-LOWER-NEXT: ptrue p1.h
; NO-UPLS-LOWER-NEXT: st1h { z0.s }, p0, [x0, #2, mul vl]
; NO-UPLS-LOWER-NEXT: st1h { z0.h }, p1, [x0]
; NO-UPLS-LOWER-NEXT: ret
;
; A64FX-LABEL: store_nxv12f16:
; A64FX: // %bb.0:
; A64FX-NEXT: fmov z0.h, #1.00000000
; A64FX-NEXT: ptrue p0.s
; A64FX-NEXT: st1h { z0.s }, p0, [x0, #2, mul vl]
; A64FX-NEXT: ptrue p0.h
; A64FX-NEXT: st1h { z0.h }, p0, [x0]
; A64FX-NEXT: ret
store <vscale x 12 x half> splat(half 1.0), ptr %out
ret void
}