Commit f6d77abc by Ben Clayton

SpirvShader: Implement GLSLstd450Asinh

Bug: b/126873455 Tests: dEQP-VK.glsl.builtin.precision.asinh.* Change-Id: I83b425bea2d693c5bcab3b1685252be0ba9fb023 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28692Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 3928bd94
......@@ -3367,7 +3367,11 @@ namespace sw
}
case GLSLstd450Asinh:
{
UNIMPLEMENTED("GLSLstd450Asinh");
auto val = GenericValue(this, routine, insn.word(5));
for (auto i = 0u; i < type.sizeInComponents; i++)
{
dst.move(i, Asinh(val.Float(i)));
}
break;
}
case GLSLstd450Acosh:
......
......@@ -562,6 +562,7 @@ namespace rr
func_.emplace("sinhf", reinterpret_cast<void*>(sinhf));
func_.emplace("coshf", reinterpret_cast<void*>(coshf));
func_.emplace("tanhf", reinterpret_cast<void*>(tanhf));
func_.emplace("asinhf", reinterpret_cast<void*>(asinhf));
#ifdef __APPLE__
// LLVM uses this function on macOS for tan.
......@@ -3138,6 +3139,11 @@ namespace rr
return TransformFloat4PerElement(v, "tanhf");
}
RValue<Float4> Asinh(RValue<Float4> v)
{
return TransformFloat4PerElement(v, "asinhf");
}
Type *Float4::getType()
{
return T(llvm::VectorType::get(T(Float::getType()), 4));
......
......@@ -2217,6 +2217,7 @@ namespace rr
RValue<Float4> Sinh(RValue<Float4> x);
RValue<Float4> Cosh(RValue<Float4> x);
RValue<Float4> Tanh(RValue<Float4> x);
RValue<Float4> Asinh(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