Replace sinh,cosh with implementations in terms of Exp()
Vulkan CTS 1.1.5 is stricter about edge cases here, and sinhf/coshf
aren't cutting it.
Test: dEQP-VK.*cosh*
Test: dEQP-VK.*sinh*
Bug: b/140501860
Change-Id: I21895cbff9f54bccb7d40fb75e09eebe7db18fa1
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35988
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index c255b81..546ac7f 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -3814,12 +3814,12 @@
RValue<Float4> Sinh(RValue<Float4> v)
{
- return TransformFloat4PerElement(v, "sinhf");
+ return Float4(0.5f) * (Exp(v) - Exp(-v));
}
RValue<Float4> Cosh(RValue<Float4> v)
{
- return TransformFloat4PerElement(v, "coshf");
+ return Float4(0.5f) * (Exp(v) + Exp(-v));
}
RValue<Float4> Tanh(RValue<Float4> v)