Commit d9636978 by Ben Clayton

SpirvShader: Implement GLSLstd450Sinh

Bug: b/126873455 Tests: dEQP-VK.glsl.builtin.precision.sinh.* Change-Id: I59239dd0623260090ac662501bdefb2da273fd97 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28688Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 749b4e0c
...@@ -3338,6 +3338,15 @@ namespace sw ...@@ -3338,6 +3338,15 @@ namespace sw
} }
break; break;
} }
case GLSLstd450Sinh:
{
auto val = GenericValue(this, routine, insn.word(5));
for (auto i = 0u; i < type.sizeInComponents; i++)
{
dst.move(i, Sinh(val.Float(i)));
}
break;
}
default: default:
UNIMPLEMENTED("Unhandled ExtInst %d", extInstIndex); UNIMPLEMENTED("Unhandled ExtInst %d", extInstIndex);
......
...@@ -559,6 +559,7 @@ namespace rr ...@@ -559,6 +559,7 @@ namespace rr
func_.emplace("asinf", reinterpret_cast<void*>(asinf)); func_.emplace("asinf", reinterpret_cast<void*>(asinf));
func_.emplace("acosf", reinterpret_cast<void*>(acosf)); func_.emplace("acosf", reinterpret_cast<void*>(acosf));
func_.emplace("atanf", reinterpret_cast<void*>(atanf)); func_.emplace("atanf", reinterpret_cast<void*>(atanf));
func_.emplace("sinhf", reinterpret_cast<void*>(sinhf));
#ifdef __APPLE__ #ifdef __APPLE__
// LLVM uses this function on macOS for tan. // LLVM uses this function on macOS for tan.
...@@ -3120,6 +3121,11 @@ namespace rr ...@@ -3120,6 +3121,11 @@ namespace rr
return TransformFloat4PerElement(v, "atanf"); return TransformFloat4PerElement(v, "atanf");
} }
RValue<Float4> Sinh(RValue<Float4> v)
{
return TransformFloat4PerElement(v, "sinhf");
}
Type *Float4::getType() Type *Float4::getType()
{ {
return T(llvm::VectorType::get(T(Float::getType()), 4)); return T(llvm::VectorType::get(T(Float::getType()), 4));
......
...@@ -2214,6 +2214,7 @@ namespace rr ...@@ -2214,6 +2214,7 @@ namespace rr
RValue<Float4> Asin(RValue<Float4> x); RValue<Float4> Asin(RValue<Float4> x);
RValue<Float4> Acos(RValue<Float4> x); RValue<Float4> Acos(RValue<Float4> x);
RValue<Float4> Atan(RValue<Float4> x); RValue<Float4> Atan(RValue<Float4> x);
RValue<Float4> Sinh(RValue<Float4> x);
template<class T> template<class T>
class Pointer : public LValue<Pointer<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