Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/known-never-nan.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

65 lines
2.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SD
; RUN: llc -mtriple=aarch64 < %s -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
; This should codegen to fmaxnm with no-signed-zeros.
define float @fmaxnm(i32 %i1, i32 %i2) #0 {
; CHECK-LABEL: fmaxnm:
; CHECK: // %bb.0:
; CHECK-NEXT: ucvtf s0, w0
; CHECK-NEXT: ucvtf s1, w1
; CHECK-NEXT: fmov s2, #11.00000000
; CHECK-NEXT: fmov s3, #17.00000000
; CHECK-NEXT: fadd s0, s0, s2
; CHECK-NEXT: fadd s1, s1, s3
; CHECK-NEXT: fcmp s0, s1
; CHECK-NEXT: fcsel s0, s0, s1, pl
; CHECK-NEXT: ret
%f1 = uitofp i32 %i1 to float
%fadd1 = fadd float %f1, 11.0
%f2 = uitofp i32 %i2 to float
%fadd2 = fadd float %f2, 17.0
%cmp = fcmp uge float %fadd1, %fadd2
%val = select i1 %cmp, float %fadd1, float %fadd2
ret float %val
}
; If f1 is 0, fmul is NaN because 0.0 * -INF = NaN
; Therefore, this is not fmaxnm.
define float @not_fmaxnm_maybe_nan(i32 %i1, i32 %i2) #0 {
; CHECK-SD-LABEL: not_fmaxnm_maybe_nan:
; CHECK-SD: // %bb.0:
; CHECK-SD-NEXT: ucvtf s0, w0
; CHECK-SD-NEXT: ucvtf s1, w1
; CHECK-SD-NEXT: mov w8, #-8388608 // =0xff800000
; CHECK-SD-NEXT: fmov s2, #17.00000000
; CHECK-SD-NEXT: fmov s3, w8
; CHECK-SD-NEXT: fmul s0, s0, s3
; CHECK-SD-NEXT: fadd s1, s1, s2
; CHECK-SD-NEXT: fcmp s0, s1
; CHECK-SD-NEXT: fcsel s0, s0, s1, pl
; CHECK-SD-NEXT: ret
;
; CHECK-GI-LABEL: not_fmaxnm_maybe_nan:
; CHECK-GI: // %bb.0:
; CHECK-GI-NEXT: ucvtf s0, w0
; CHECK-GI-NEXT: ucvtf s1, w1
; CHECK-GI-NEXT: mov w8, #-8388608 // =0xff800000
; CHECK-GI-NEXT: fmov s2, #17.00000000
; CHECK-GI-NEXT: fmov s3, w8
; CHECK-GI-NEXT: fmul s0, s0, s3
; CHECK-GI-NEXT: fadd s1, s1, s2
; CHECK-GI-NEXT: fmax s0, s0, s1
; CHECK-GI-NEXT: ret
%f1 = uitofp i32 %i1 to float
%fmul = fmul float %f1, 0xfff0000000000000 ; -INFINITY as 64-bit hex
%f2 = uitofp i32 %i2 to float
%fadd2 = fadd float %f2, 17.0
%cmp = fcmp uge float %fmul, %fadd2
%val = select i1 %cmp, float %fmul, float %fadd2
ret float %val
}
attributes #0 = { "no-signed-zeros-fp-math"="true" }