<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add FP64 support to the i965 shader backends"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=92760#c18">Comment # 18</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add FP64 support to the i965 shader backends"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=92760">bug 92760</a>
              from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
        <pre>(In reply to Matt Turner from <a href="show_bug.cgi?id=92760#c16">comment #16</a>)
<span class="quote">> (In reply to Connor Abbott from <a href="show_bug.cgi?id=92760#c15">comment #15</a>)
> > 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.</span >

Thanks Matt! I had a quick look for this yesterday but did not find exactly
what I need yet. If you happen to dig it up back that would be great, I'll keep
looking for it on my side though, so no pressure :)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>