SpirvShader: Implement GLSLstd450Cosh
Bug: b/126873455
Tests: dEQP-VK.glsl.builtin.precision.cosh.*
Change-Id: I25b8d84bb8be76b816afade7c62e70fda2c926a0
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28690
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index a837ca5..d41cb0e 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -560,6 +560,7 @@
func_.emplace("acosf", reinterpret_cast<void*>(acosf));
func_.emplace("atanf", reinterpret_cast<void*>(atanf));
func_.emplace("sinhf", reinterpret_cast<void*>(sinhf));
+ func_.emplace("coshf", reinterpret_cast<void*>(coshf));
#ifdef __APPLE__
// LLVM uses this function on macOS for tan.
@@ -3126,6 +3127,11 @@
return TransformFloat4PerElement(v, "sinhf");
}
+ RValue<Float4> Cosh(RValue<Float4> v)
+ {
+ return TransformFloat4PerElement(v, "coshf");
+ }
+
Type *Float4::getType()
{
return T(llvm::VectorType::get(T(Float::getType()), 4));