Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/DirectX/saturate.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

66 lines
2.4 KiB
LLVM

; RUN: opt -S -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
; Make sure the intrinsic dx.saturate is to appropriate DXIL op for half/float/double data types.
; CHECK-LABEL: test_saturate_half
define noundef half @test_saturate_half(half noundef %p0) {
entry:
; CHECK: call half @dx.op.unary.f16(i32 7, half %p0)
%hlsl.saturate = call half @llvm.dx.saturate.f16(half %p0)
; CHECK: ret half
ret half %hlsl.saturate
}
; CHECK-LABEL: test_saturate_float
define noundef float @test_saturate_float(float noundef %p0) {
entry:
; CHECK: call float @dx.op.unary.f32(i32 7, float %p0)
%hlsl.saturate = call float @llvm.dx.saturate.f32(float %p0)
; CHECK: ret float
ret float %hlsl.saturate
}
; CHECK-LABEL: test_saturate_double
define noundef double @test_saturate_double(double noundef %p0) {
entry:
; CHECK: call double @dx.op.unary.f64(i32 7, double %p0)
%hlsl.saturate = call double @llvm.dx.saturate.f64(double %p0)
; CHECK: ret double
ret double %hlsl.saturate
}
; CHECK-LABEL: test_saturate_half4
define noundef <4 x half> @test_saturate_half4(<4 x half> noundef %p0) {
entry:
; CHECK: call half @dx.op.unary.f16(i32 7, half
; CHECK: call half @dx.op.unary.f16(i32 7, half
; CHECK: call half @dx.op.unary.f16(i32 7, half
; CHECK: call half @dx.op.unary.f16(i32 7, half
%hlsl.saturate = call <4 x half> @llvm.dx.saturate.v4f16(<4 x half> %p0)
ret <4 x half> %hlsl.saturate
}
; CHECK-LABEL: test_saturate_float3
define noundef <3 x float> @test_saturate_float3(<3 x float> noundef %p0) {
entry:
; CHECK: call float @dx.op.unary.f32(i32 7, float
; CHECK: call float @dx.op.unary.f32(i32 7, float
; CHECK: call float @dx.op.unary.f32(i32 7, float
%hlsl.saturate = call <3 x float> @llvm.dx.saturate.v3f32(<3 x float> %p0)
ret <3 x float> %hlsl.saturate
}
; CHECK-LABEL: test_saturate_double2
define noundef <2 x double> @test_saturate_double2(<2 x double> noundef %p0) {
entry:
; CHECK: call double @dx.op.unary.f64(i32 7, double
; CHECK: call double @dx.op.unary.f64(i32 7, double
%hlsl.saturate = call <2 x double> @llvm.dx.saturate.v4f64(<2 x double> %p0)
ret <2 x double> %hlsl.saturate
}
; CHECK-DAG: declare half @dx.op.unary.f16(i32, half) #[[#ATTR0:]]
; CHECK-DAG: declare float @dx.op.unary.f32(i32, float) #[[#ATTR0]]
; CHECK-DAG: declare double @dx.op.unary.f64(i32, double) #[[#ATTR0]]
; CHECK: attributes #[[#ATTR0]] = { nounwind memory(none) }