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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 30 20:48:35 PST 2015


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

--- Comment #16 from Matt Turner <mattst88 at gmail.com> ---
(In reply to Connor Abbott from comment #15)
> 2. "i965/fs: fix ceil/floor for doubles" -- sorry, you're not going to get
> off that easily :) You can't use floats here, since you're going to run into
> range and precision issues. If the piglit tests don't test for those, then
> they need to be fixed. Since we don't have HW support for
> ceil/floor/trunc/etc., you're going to need to implement them using integer
> operations. I was planning on doing this in nir_lower_double_ops.c. I think
> trunc is the easiest to implement using integer ops -- you don't need to
> worry about the sign, you just have to mask off the appropriate number of
> bits in the mantissa based on the exponent -- but the rub is that 64-bit
> integer arithmetic isn't implemented yet in NIR or the backend, and it
> doesn't even exist prior to Broadwell, so you have to split the double into
> 32-bit chunks and operate on those. Then once you've implemented trunc, you
> can implement all the other missing operations in terms  of it. Have fun :)

I knew at one point how to do these...

You basically implement trunc using bit operations (by looking at the exponent
figure out how many bits of the mantissa you need to mask off, I think), and
then you can implement floor and ceil by trunc(x ± nextafter(0.5, 0.0)).

Round-to-even was a little harder and I think required an explicit test against
x.5.

I'll see if I can dig it back up.

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


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