Commit 28ebcb01 by Ben Clayton

SpirvShader: Implement GLSLstd450Acosh

Bug: b/126873455 Tests: dEQP-VK.glsl.builtin.precision.acosh.* Change-Id: Id02fae0c7020ee83cb612f9370cdbb5c4dc31af1 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28693Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent f6d77abc
......@@ -3376,7 +3376,11 @@ namespace sw
}
case GLSLstd450Acosh:
{
UNIMPLEMENTED("GLSLstd450Acosh");
auto val = GenericValue(this, routine, insn.word(5));
for (auto i = 0u; i < type.sizeInComponents; i++)
{
dst.move(i, Acosh(val.Float(i)));
}
break;
}
case GLSLstd450Atanh:
......
......@@ -563,6 +563,7 @@ namespace rr
func_.emplace("coshf", reinterpret_cast<void*>(coshf));
func_.emplace("tanhf", reinterpret_cast<void*>(tanhf));
func_.emplace("asinhf", reinterpret_cast<void*>(asinhf));
func_.emplace("acoshf", reinterpret_cast<void*>(acoshf));
#ifdef __APPLE__
// LLVM uses this function on macOS for tan.
......@@ -3144,6 +3145,11 @@ namespace rr
return TransformFloat4PerElement(v, "asinhf");
}
RValue<Float4> Acosh(RValue<Float4> v)
{
return TransformFloat4PerElement(v, "acoshf");
}
Type *Float4::getType()
{
return T(llvm::VectorType::get(T(Float::getType()), 4));
......
......@@ -2218,6 +2218,7 @@ namespace rr
RValue<Float4> Cosh(RValue<Float4> x);
RValue<Float4> Tanh(RValue<Float4> x);
RValue<Float4> Asinh(RValue<Float4> x);
RValue<Float4> Acosh(RValue<Float4> x);
template<class T>
class Pointer : public LValue<Pointer<T>>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment