Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/avx512fp16-unsafe-fp-math.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

191 lines
5.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64 -mattr=+avx512fp16,+avx512vl | FileCheck %s
define <32 x half> @test_max_v32f16(ptr %a_ptr, <32 x half> %b) {
; CHECK-LABEL: test_max_v32f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vmaxph (%rdi), %zmm0, %zmm0
; CHECK-NEXT: retq
%a = load <32 x half>, ptr %a_ptr
%tmp = fcmp ogt <32 x half> %a, %b
%tmp4 = select nsz nnan <32 x i1> %tmp, <32 x half> %a, <32 x half> %b
ret <32 x half> %tmp4
}
define <32 x half> @test_max_v32f16_safe(ptr %a_ptr, <32 x half> %b) {
; CHECK-LABEL: test_max_v32f16_safe:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps (%rdi), %zmm1
; CHECK-NEXT: vmaxph %zmm0, %zmm1, %zmm0
; CHECK-NEXT: retq
%a = load <32 x half>, ptr %a_ptr
%tmp = fcmp ogt <32 x half> %a, %b
%tmp4 = select <32 x i1> %tmp, <32 x half> %a, <32 x half> %b
ret <32 x half> %tmp4
}
define <32 x half> @test_min_v32f16(ptr %a_ptr, <32 x half> %b) {
; CHECK-LABEL: test_min_v32f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vminph (%rdi), %zmm0, %zmm0
; CHECK-NEXT: retq
%a = load <32 x half>, ptr %a_ptr
%tmp = fcmp olt <32 x half> %a, %b
%tmp4 = select nsz nnan <32 x i1> %tmp, <32 x half> %a, <32 x half> %b
ret <32 x half> %tmp4
}
define <32 x half> @test_min_v32f16_safe(ptr %a_ptr, <32 x half> %b) {
; CHECK-LABEL: test_min_v32f16_safe:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps (%rdi), %zmm1
; CHECK-NEXT: vminph %zmm0, %zmm1, %zmm0
; CHECK-NEXT: retq
%a = load <32 x half>, ptr %a_ptr
%tmp = fcmp olt <32 x half> %a, %b
%tmp4 = select <32 x i1> %tmp, <32 x half> %a, <32 x half> %b
ret <32 x half> %tmp4
}
define <16 x half> @test_max_v16f16(ptr %a_ptr, <16 x half> %b) {
; CHECK-LABEL: test_max_v16f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vmaxph (%rdi), %ymm0, %ymm0
; CHECK-NEXT: retq
%a = load <16 x half>, ptr %a_ptr
%tmp = fcmp ogt <16 x half> %a, %b
%tmp4 = select nsz nnan <16 x i1> %tmp, <16 x half> %a, <16 x half> %b
ret <16 x half> %tmp4
}
define <16 x half> @test_max_v16f16_safe(ptr %a_ptr, <16 x half> %b) {
; CHECK-LABEL: test_max_v16f16_safe:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps (%rdi), %ymm1
; CHECK-NEXT: vmaxph %ymm0, %ymm1, %ymm0
; CHECK-NEXT: retq
%a = load <16 x half>, ptr %a_ptr
%tmp = fcmp ogt <16 x half> %a, %b
%tmp4 = select <16 x i1> %tmp, <16 x half> %a, <16 x half> %b
ret <16 x half> %tmp4
}
define <16 x half> @test_min_v16f16(ptr %a_ptr, <16 x half> %b) {
; CHECK-LABEL: test_min_v16f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vminph (%rdi), %ymm0, %ymm0
; CHECK-NEXT: retq
%a = load <16 x half>, ptr %a_ptr
%tmp = fcmp olt <16 x half> %a, %b
%tmp4 = select nsz nnan <16 x i1> %tmp, <16 x half> %a, <16 x half> %b
ret <16 x half> %tmp4
}
define <16 x half> @test_min_v16f16_safe(ptr %a_ptr, <16 x half> %b) {
; CHECK-LABEL: test_min_v16f16_safe:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps (%rdi), %ymm1
; CHECK-NEXT: vminph %ymm0, %ymm1, %ymm0
; CHECK-NEXT: retq
%a = load <16 x half>, ptr %a_ptr
%tmp = fcmp fast olt <16 x half> %a, %b
%tmp4 = select <16 x i1> %tmp, <16 x half> %a, <16 x half> %b
ret <16 x half> %tmp4
}
define <8 x half> @test_max_v8f16(ptr %a_ptr, <8 x half> %b) {
; CHECK-LABEL: test_max_v8f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vmaxph (%rdi), %xmm0, %xmm0
; CHECK-NEXT: retq
%a = load <8 x half>, ptr %a_ptr
%tmp = fcmp ogt <8 x half> %a, %b
%tmp4 = select nsz nnan <8 x i1> %tmp, <8 x half> %a, <8 x half> %b
ret <8 x half> %tmp4
}
define <8 x half> @test_max_v8f16_safe(ptr %a_ptr, <8 x half> %b) {
; CHECK-LABEL: test_max_v8f16_safe:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps (%rdi), %xmm1
; CHECK-NEXT: vmaxph %xmm0, %xmm1, %xmm0
; CHECK-NEXT: retq
%a = load <8 x half>, ptr %a_ptr
%tmp = fcmp ogt <8 x half> %a, %b
%tmp4 = select <8 x i1> %tmp, <8 x half> %a, <8 x half> %b
ret <8 x half> %tmp4
}
define <8 x half> @test_min_v8f16(ptr %a_ptr, <8 x half> %b) {
; CHECK-LABEL: test_min_v8f16:
; CHECK: # %bb.0:
; CHECK-NEXT: vminph (%rdi), %xmm0, %xmm0
; CHECK-NEXT: retq
%a = load <8 x half>, ptr %a_ptr
%tmp = fcmp olt <8 x half> %a, %b
%tmp4 = select nsz nnan <8 x i1> %tmp, <8 x half> %a, <8 x half> %b
ret <8 x half> %tmp4
}
define <8 x half> @test_min_v8f16_safe(ptr %a_ptr, <8 x half> %b) {
; CHECK-LABEL: test_min_v8f16_safe:
; CHECK: # %bb.0:
; CHECK-NEXT: vmovaps (%rdi), %xmm1
; CHECK-NEXT: vminph %xmm0, %xmm1, %xmm0
; CHECK-NEXT: retq
%a = load <8 x half>, ptr %a_ptr
%tmp = fcmp olt <8 x half> %a, %b
%tmp4 = select <8 x i1> %tmp, <8 x half> %a, <8 x half> %b
ret <8 x half> %tmp4
}
define half @test_max_f16(half %a, ptr %ptr) {
; CHECK-LABEL: test_max_f16:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vmaxsh (%rdi), %xmm0, %xmm0
; CHECK-NEXT: retq
entry:
%0 = load half, ptr %ptr
%1 = fcmp ogt half %0, %a
%2 = select nsz nnan i1 %1, half %0, half %a
ret half %2
}
define half @test_max_f16_safe(half %a, ptr %ptr) {
; CHECK-LABEL: test_max_f16_safe:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; CHECK-NEXT: vmaxsh %xmm0, %xmm1, %xmm0
; CHECK-NEXT: retq
entry:
%0 = load half, ptr %ptr
%1 = fcmp ogt half %0, %a
%2 = select i1 %1, half %0, half %a
ret half %2
}
define half @test_min_f16(half %a, ptr %ptr) {
; CHECK-LABEL: test_min_f16:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vminsh (%rdi), %xmm0, %xmm0
; CHECK-NEXT: retq
entry:
%0 = load half, ptr %ptr
%1 = fcmp olt half %0, %a
%2 = select nsz nnan i1 %1, half %0, half %a
ret half %2
}
define half @test_min_f16_safe(half %a, ptr %ptr) {
; CHECK-LABEL: test_min_f16_safe:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: vmovsh {{.*#+}} xmm1 = mem[0],zero,zero,zero,zero,zero,zero,zero
; CHECK-NEXT: vminsh %xmm0, %xmm1, %xmm0
; CHECK-NEXT: retq
entry:
%0 = load half, ptr %ptr
%1 = fcmp olt half %0, %a
%2 = select i1 %1, half %0, half %a
ret half %2
}