llvm-project/llvm/test/CodeGen/DirectX/saturate_errors.ll
S. Bharadwaj Yadavalli 6a38e19c92
[HLSL] Implement support for HLSL intrinsic - saturate (#104619)
Implement support for HLSL intrinsic saturate.
Implement DXIL codegen for the intrinsic saturate by lowering it to DXIL
Op dx.saturate.
Implement SPIRV codegen by transforming saturate(x) to clamp(x, 0.0f,
1.0f).

Add tests for DXIL and SPIRV CodeGen.
2024-08-20 12:46:33 -04:00

11 lines
344 B
LLVM

; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
; DXIL operation saturate does not support i32 overload
; CHECK: invalid intrinsic signature
define noundef i32 @test_saturate_i32(i32 noundef %p0) #0 {
entry:
%hlsl.saturate = call i32 @llvm.dx.saturate.i32(i32 %p0)
ret i32 %hlsl.saturate
}