Commit 0b7003bd by Alexis Hetu Committed by Alexis Hétu

Fixes for exp and log functions

- Fixed how logarithm2() handles infinity - Fixed a typo in exponential() These fixes combined fix all dEQP failures for: sinh, cosh, pow, exp, log, log2 Change-Id: I2d427892032fc5f75909a5609f606a787b08505a Reviewed-on: https://swiftshader-review.googlesource.com/13708Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 8ef6d109
......@@ -166,13 +166,14 @@ namespace sw
x1 += (x0 - Float4(1.0f)) * x2;
return x1;
Int4 pos_inf_x = CmpEQ(As<Int4>(x), Int4(0x7F800000));
return As<Float4>((pos_inf_x & As<Int4>(x)) | (~pos_inf_x & As<Int4>(x1)));
}
Float4 exponential(RValue<Float4> x, bool pp)
{
// FIXME: Propagate the constant
return exponential2(Float4(1.44269541f) * x, pp); // 1/ln(2)
return exponential2(Float4(1.44269504f) * x, pp); // 1/ln(2)
}
Float4 logarithm(RValue<Float4> x, bool absolute, bool pp)
......
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