Commit 3ebf583c by Chris Forbes

Protect against DBZ in OpUMod also

Bug: b/127962486 Test: dEQP-VK.glsl.operator.binary_operator.mod.* Change-Id: I6aee79c99b50f936512e9d9b4b51a07006445694 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27208Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent eb7cf3c4
......@@ -1566,8 +1566,11 @@ namespace sw
break;
}
case spv::OpUMod:
dst.emplace(i, lhs.UInt(i) % rhs.UInt(i));
{
auto zeroMask = As<SIMD::UInt>(CmpEQ(rhs.Int(i), SIMD::Int(0)));
dst.emplace(i, lhs.UInt(i) % (rhs.UInt(i) | zeroMask));
break;
}
case spv::OpIEqual:
case spv::OpLogicalEqual:
dst.emplace(i, CmpEQ(lhs.Int(i), rhs.Int(i)));
......
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