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

83 lines
2.1 KiB
LLVM

; RUN: llc < %s -mtriple=nvptx64 | FileCheck %s --check-prefixes=CHECK
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_80 | FileCheck %s --check-prefixes=CHECK
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 | %ptxas-verify %}
; RUN: %if ptxas-sm_80 %{ llc < %s -mtriple=nvptx64 -mcpu=sm_80 | %ptxas-verify -arch=sm_80 %}
; ---- minimum ----
; CHECK-LABEL: minimum_half
define half @minimum_half(half %a) #0 {
; CHECK: setp
; CHECK: selp.b16
%p = fcmp ult half %a, 0.0
%x = select i1 %p, half %a, half 0.0
ret half %x
}
; CHECK-LABEL: minimum_float
define float @minimum_float(float %a) #0 {
; CHECK: setp
; CHECK: selp.f32
%p = fcmp ult float %a, 0.0
%x = select i1 %p, float %a, float 0.0
ret float %x
}
; CHECK-LABEL: minimum_double
define double @minimum_double(double %a) #0 {
; CHECK: setp
; CHECK: selp.f64
%p = fcmp ult double %a, 0.0
%x = select i1 %p, double %a, double 0.0
ret double %x
}
; CHECK-LABEL: minimum_v2half
define <2 x half> @minimum_v2half(<2 x half> %a) #0 {
; CHECK-DAG: setp
; CHECK-DAG: selp.b16
; CHECK-DAG: selp.b16
%p = fcmp ult <2 x half> %a, zeroinitializer
%x = select <2 x i1> %p, <2 x half> %a, <2 x half> zeroinitializer
ret <2 x half> %x
}
; ---- maximum ----
; CHECK-LABEL: maximum_half
define half @maximum_half(half %a) #0 {
; CHECK: setp
; CHECK: selp.b16
%p = fcmp ugt half %a, 0.0
%x = select i1 %p, half %a, half 0.0
ret half %x
}
; CHECK-LABEL: maximum_float
define float @maximum_float(float %a) #0 {
; CHECK: setp
; CHECK: selp.f32
%p = fcmp ugt float %a, 0.0
%x = select i1 %p, float %a, float 0.0
ret float %x
}
; CHECK-LABEL: maximum_double
define double @maximum_double(double %a) #0 {
; CHECK: setp
; CHECK: selp.f64
%p = fcmp ugt double %a, 0.0
%x = select i1 %p, double %a, double 0.0
ret double %x
}
; CHECK-LABEL: maximum_v2half
define <2 x half> @maximum_v2half(<2 x half> %a) #0 {
; CHECK-DAG: setp
; CHECK-DAG: selp.b16
; CHECK-DAG: selp.b16
%p = fcmp ugt <2 x half> %a, zeroinitializer
%x = select <2 x i1> %p, <2 x half> %a, <2 x half> zeroinitializer
ret <2 x half> %x
}