[Bug 92760] Add FP64 support to the i965 shader backends

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Apr 1 12:07:44 UTC 2016


--- Comment #68 from Samuel Iglesias <siglesias at igalia.com> ---
Hello Jason, Connor:

I have found a problem with mod() working with double operands: mod(x, y) is
calculated as x - y * floor(x/y).

When working with doubles on i965, we need to do two lowering passes:
one to calculate the reciprocal of 'y' and other for the floor().

If x == y, then x/y == 1.0 but I found that calculated value is slightly
less than 1.0 because of rounding errors. In that case, floor() returns 0.0 and
mod(x,y) ends up returning 'y' instead of 0. This is not happening for all
values and that's the reason we have not seen it before.

We propose to create a lowering pass for mod() with doubles in
nir_lowering_double_ops, where we check if x == y and return zero or the
formula depending on the case. It would affect the performance for mod()
operation due to the added bcsel but, as it only affects doubles (we can make
nir_opt_algebraic to skip the double's case), we think it is not a bad idea.

What do you think?

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20160401/200a2cda/attachment.html>

More information about the intel-3d-bugs mailing list