[Mesa-dev] [Bug 83570] Glyphy demo throws unhandled Integer division by zero exception

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 11 07:49:41 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=83570

--- Comment #13 from Roland Scheidegger <sroland at vmware.com> ---
(In reply to comment #12)
> Roland,
>   Perhaps you can help me here. I'm looking at udiv_emit_cpu and I'm just
> not getting it. The comment says:
> 
> /* udiv by zero is guaranteed to return 0xffffffff */
> 
> but the way I read it, udiv by zero returns the numerator. Am I missing
> something?

Well in the end it is "ored" with the comparison mask, hence it's going to be
all ones (comparison masks are either all ones or all zeros). So the first or
is there to make sure the zero in the division gets replaced by something else
(all ones because this is easiest) so it doesn't crash, and the second or is
there to make sure the result is all ones (because d3d10 requires this result,
but since d3d10 lacks signed integer division there's not really any such
requirement for idiv).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140911/8f18f0af/attachment.html>


More information about the mesa-dev mailing list