[mlir][spirv][nfc] Add missing tests for GL Tanh Op (#143538)

The problem was noticed when adding Log2 operation.
This commit is contained in:
Igor Wodiany
2025-06-10 15:40:22 +01:00
committed by GitHub
parent 713702109a
commit f7967effa3
2 changed files with 28 additions and 0 deletions

View File

@@ -763,3 +763,29 @@ func.func @log2_invalid_type(%arg0 : i32) -> () {
%0 = spirv.GL.Log2 %arg0 : i32
return
}
// -----
//===----------------------------------------------------------------------===//
// spirv.GL.Tanh
//===----------------------------------------------------------------------===//
func.func @tanh(%arg0 : f32) -> () {
// CHECK: spirv.GL.Tanh {{%.*}} : f32
%0 = spirv.GL.Tanh %arg0 : f32
return
}
func.func @tanhvec(%arg0 : vector<3xf16>) -> () {
// CHECK: spirv.GL.Tanh {{%.*}} : vector<3xf16>
%0 = spirv.GL.Tanh %arg0 : vector<3xf16>
return
}
// -----
func.func @tanh_invalid_type(%arg0 : i32) -> () {
// expected-error @+1 {{op operand #0 must be 16/32-bit float or vector of 16/32-bit float values}}
%0 = spirv.GL.Tanh %arg0 : i32
return
}

View File

@@ -42,6 +42,8 @@ spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader], []> {
%19 = spirv.GL.Atanh %arg0 : f32
// CHECK: {{%.*}} = spirv.GL.Log2 {{%.*}} : f32
%20 = spirv.GL.Log2 %arg0 : f32
// CHECK: {{%.*}} = spirv.GL.Tanh {{%.*}} : f32
%21 = spirv.GL.Tanh %arg0 : f32
spirv.Return
}