Commit 44e6523d by Chris Forbes

Fix ldexp builtin with vectors

In a few places we were always looking at component 0, which obviously doesn't go well. Bug: b/140648938 Test: dEQP-VK.*ldexp* Change-Id: I6a8698a56beab8ccc3b41a729d399b957cde9495 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36113Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent a12195b9
......@@ -4229,7 +4229,7 @@ namespace sw
auto in = significand.Float(i);
auto significandExponent = Exponent(in);
auto combinedExponent = exponent.Int(i) + significandExponent;
auto isSignificandZero = SIMD::UInt(CmpEQ(significand.Int(0), SIMD::Int(0)));
auto isSignificandZero = SIMD::UInt(CmpEQ(significand.Int(i), SIMD::Int(0)));
auto isSignificandInf = SIMD::UInt(IsInf(in));
auto isSignificandNaN = SIMD::UInt(IsNan(in));
auto isExponentNotTooSmall = SIMD::UInt(CmpGE(combinedExponent, SIMD::Int(-126)));
......@@ -4247,7 +4247,7 @@ namespace sw
// If the input significand is zero, inf or nan, just return the
// input significand.
auto passthrough = isSignificandZero | isSignificandInf | isSignificandNaN;
v = (v & ~passthrough) | (significand.UInt(0) & passthrough);
v = (v & ~passthrough) | (significand.UInt(i) & passthrough);
dst.move(i, As<SIMD::Float>(v));
}
......
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