Skip to content

Commit 44e6523

Browse files
committed
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/+/36113 Tested-by: Chris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
1 parent a12195b commit 44e6523

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Pipeline/SpirvShader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,7 +4229,7 @@ namespace sw
42294229
auto in = significand.Float(i);
42304230
auto significandExponent = Exponent(in);
42314231
auto combinedExponent = exponent.Int(i) + significandExponent;
4232-
auto isSignificandZero = SIMD::UInt(CmpEQ(significand.Int(0), SIMD::Int(0)));
4232+
auto isSignificandZero = SIMD::UInt(CmpEQ(significand.Int(i), SIMD::Int(0)));
42334233
auto isSignificandInf = SIMD::UInt(IsInf(in));
42344234
auto isSignificandNaN = SIMD::UInt(IsNan(in));
42354235
auto isExponentNotTooSmall = SIMD::UInt(CmpGE(combinedExponent, SIMD::Int(-126)));
@@ -4247,7 +4247,7 @@ namespace sw
42474247
// If the input significand is zero, inf or nan, just return the
42484248
// input significand.
42494249
auto passthrough = isSignificandZero | isSignificandInf | isSignificandNaN;
4250-
v = (v & ~passthrough) | (significand.UInt(0) & passthrough);
4250+
v = (v & ~passthrough) | (significand.UInt(i) & passthrough);
42514251

42524252
dst.move(i, As<SIMD::Float>(v));
42534253
}

0 commit comments

Comments
 (0)