Files
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

69 lines
2.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64 -mattr=+fullfp16 < %s | FileCheck %s
define half @test_v4f16_element_3_zero(<4 x half> %vec) {
; CHECK-LABEL: test_v4f16_element_3_zero:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
; CHECK-NEXT: mov h1, v0.h[2]
; CHECK-NEXT: faddp h0, v0.2h
; CHECK-NEXT: fadd h0, h0, h1
; CHECK-NEXT: ret
entry:
%with_zero = insertelement <4 x half> %vec, half 0.0, i64 3
%sum = call reassoc nsz half @llvm.vector.reduce.fadd.v4f16(half -0.0, <4 x half> %with_zero)
ret half %sum
}
define half @test_v8f16_elements_567_zero(<8 x half> %vec) {
; CHECK-LABEL: test_v8f16_elements_567_zero:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: mov h1, v0.h[3]
; CHECK-NEXT: mov h2, v0.h[2]
; CHECK-NEXT: faddp h3, v0.2h
; CHECK-NEXT: mov h0, v0.h[4]
; CHECK-NEXT: fadd h1, h2, h1
; CHECK-NEXT: fadd h0, h3, h0
; CHECK-NEXT: fadd h0, h0, h1
; CHECK-NEXT: ret
entry:
%zero5 = insertelement <8 x half> %vec, half 0.0, i64 5
%zero6 = insertelement <8 x half> %zero5, half 0.0, i64 6
%zero7 = insertelement <8 x half> %zero6, half 0.0, i64 7
%sum = call reassoc nsz half @llvm.vector.reduce.fadd.v8f16(half -0.0, <8 x half> %zero7)
ret half %sum
}
define half @negative_test_v8f16_elements_67_zero(<8 x half> %vec) {
; CHECK-LABEL: negative_test_v8f16_elements_67_zero:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: movi d1, #0000000000000000
; CHECK-NEXT: mov v0.h[6], v1.h[0]
; CHECK-NEXT: mov v0.h[7], v1.h[0]
; CHECK-NEXT: faddp v1.8h, v0.8h, v0.8h
; CHECK-NEXT: faddp v0.8h, v1.8h, v0.8h
; CHECK-NEXT: faddp h0, v0.2h
; CHECK-NEXT: ret
entry:
%zero6 = insertelement <8 x half> %vec, half 0.0, i64 6
%zero7 = insertelement <8 x half> %zero6, half 0.0, i64 7
%sum = call reassoc nsz half @llvm.vector.reduce.fadd.v8f16(half -0.0, <8 x half> %zero7)
ret half %sum
}
; Negative test: only one zero element out of eight is not enough to decompose.
define half @negative_test_v8f16_one_zero(<8 x half> %vec) {
; CHECK-LABEL: negative_test_v8f16_one_zero:
; CHECK: // %bb.0: // %entry
; CHECK-NEXT: movi d1, #0000000000000000
; CHECK-NEXT: mov v0.h[7], v1.h[0]
; CHECK-NEXT: faddp v1.8h, v0.8h, v0.8h
; CHECK-NEXT: faddp v0.8h, v1.8h, v0.8h
; CHECK-NEXT: faddp h0, v0.2h
; CHECK-NEXT: ret
entry:
%with_zero = insertelement <8 x half> %vec, half 0.0, i64 7
%sum = call reassoc nsz half @llvm.vector.reduce.fadd.v8f16(half -0.0, <8 x half> %with_zero)
ret half %sum
}