Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/complex-deinterleaving-f32-add.ll
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

95 lines
4.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16 -o - | FileCheck %s
target triple = "aarch64"
; Expected to transform
define <2 x float> @complex_add_v2f32(<2 x float> %a, <2 x float> %b) {
; CHECK-LABEL: complex_add_v2f32:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: fcadd v0.2s, v1.2s, v0.2s, #90
; CHECK-NEXT: ret
entry:
%a.real = shufflevector <2 x float> %a, <2 x float> zeroinitializer, <1 x i32> <i32 0>
%a.imag = shufflevector <2 x float> %a, <2 x float> zeroinitializer, <1 x i32> <i32 1>
%b.real = shufflevector <2 x float> %b, <2 x float> zeroinitializer, <1 x i32> <i32 0>
%b.imag = shufflevector <2 x float> %b, <2 x float> zeroinitializer, <1 x i32> <i32 1>
%0 = fsub fast <1 x float> %b.real, %a.imag
%1 = fadd fast <1 x float> %b.imag, %a.real
%interleaved.vec = shufflevector <1 x float> %0, <1 x float> %1, <2 x i32> <i32 0, i32 1>
ret <2 x float> %interleaved.vec
}
; Expected to transform
define <4 x float> @complex_add_v4f32(<4 x float> %a, <4 x float> %b) {
; CHECK-LABEL: complex_add_v4f32:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: fcadd v0.4s, v1.4s, v0.4s, #90
; CHECK-NEXT: ret
entry:
%a.real = shufflevector <4 x float> %a, <4 x float> zeroinitializer, <2 x i32> <i32 0, i32 2>
%a.imag = shufflevector <4 x float> %a, <4 x float> zeroinitializer, <2 x i32> <i32 1, i32 3>
%b.real = shufflevector <4 x float> %b, <4 x float> zeroinitializer, <2 x i32> <i32 0, i32 2>
%b.imag = shufflevector <4 x float> %b, <4 x float> zeroinitializer, <2 x i32> <i32 1, i32 3>
%0 = fsub fast <2 x float> %b.real, %a.imag
%1 = fadd fast <2 x float> %b.imag, %a.real
%interleaved.vec = shufflevector <2 x float> %0, <2 x float> %1, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
ret <4 x float> %interleaved.vec
}
; Expected to transform
define <8 x float> @complex_add_v8f32(<8 x float> %a, <8 x float> %b) {
; CHECK-LABEL: complex_add_v8f32:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: fcadd v1.4s, v3.4s, v1.4s, #90
; CHECK-NEXT: fcadd v0.4s, v2.4s, v0.4s, #90
; CHECK-NEXT: ret
entry:
%a.real = shufflevector <8 x float> %a, <8 x float> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%a.imag = shufflevector <8 x float> %a, <8 x float> zeroinitializer, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%b.real = shufflevector <8 x float> %b, <8 x float> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%b.imag = shufflevector <8 x float> %b, <8 x float> zeroinitializer, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%0 = fsub fast <4 x float> %b.real, %a.imag
%1 = fadd fast <4 x float> %b.imag, %a.real
%interleaved.vec = shufflevector <4 x float> %0, <4 x float> %1, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
ret <8 x float> %interleaved.vec
}
; Expected to transform
define <16 x float> @complex_add_v16f32(<16 x float> %a, <16 x float> %b) {
; CHECK-LABEL: complex_add_v16f32:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: fcadd v2.4s, v6.4s, v2.4s, #90
; CHECK-NEXT: fcadd v0.4s, v4.4s, v0.4s, #90
; CHECK-NEXT: fcadd v1.4s, v5.4s, v1.4s, #90
; CHECK-NEXT: fcadd v3.4s, v7.4s, v3.4s, #90
; CHECK-NEXT: ret
entry:
%a.real = shufflevector <16 x float> %a, <16 x float> zeroinitializer, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
%a.imag = shufflevector <16 x float> %a, <16 x float> zeroinitializer, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
%b.real = shufflevector <16 x float> %b, <16 x float> zeroinitializer, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
%b.imag = shufflevector <16 x float> %b, <16 x float> zeroinitializer, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
%0 = fsub fast <8 x float> %b.real, %a.imag
%1 = fadd fast <8 x float> %b.imag, %a.real
%interleaved.vec = shufflevector <8 x float> %0, <8 x float> %1, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
ret <16 x float> %interleaved.vec
}
; A variant of complex_add_v2f32 that uses ConstantFP(0.0) rather than ConstantAggregateZero.
define <2 x float> @complex_add_v2f32_no_CAZ(<2 x float> %a, <2 x float> %b) {
; CHECK-LABEL: complex_add_v2f32_no_CAZ:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: fcadd v0.2s, v1.2s, v0.2s, #90
; CHECK-NEXT: ret
entry:
%a.real = shufflevector <2 x float> %a, <2 x float> splat (float +0.0), <1 x i32> <i32 0>
%a.imag = shufflevector <2 x float> %a, <2 x float> splat (float +0.0), <1 x i32> <i32 1>
%b.real = shufflevector <2 x float> %b, <2 x float> splat (float +0.0), <1 x i32> <i32 0>
%b.imag = shufflevector <2 x float> %b, <2 x float> splat (float +0.0), <1 x i32> <i32 1>
%0 = fsub fast <1 x float> %b.real, %a.imag
%1 = fadd fast <1 x float> %b.imag, %a.real
%interleaved.vec = shufflevector <1 x float> %0, <1 x float> %1, <2 x i32> <i32 0, i32 1>
ret <2 x float> %interleaved.vec
}