[Bug 89970] i965/fs: copy propagate should propagate bitwise not into logic operations

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jul 18 22:14:40 UTC 2018


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

--- Comment #4 from Ian Romanick <idr at freedesktop.org> ---
At the time, we generated intBitsToFloat(b & floatBitsToInt(1.0)) to do b2f
conversions.  Since b could only be 0 or -1, ~b & 0x38f00000 produces the same
possible values as -b & 0x37f00000.  However, we now emit float(-b) instead, so
I don't think this can occur anymore.

Maybe generating ~b & 0x3f800000 (BDW+) or -b & 0x38f00000 (SNB - HSW) for
float(!b) is better?  Right now there's a late optimization in
nir_opt_algebraic that does this:

   (('b2f(is_used_more_than_once)', ('inot', a)), ('bcsel', a, 0.0, 1.0)),
   (('fneg(is_used_more_than_once)', ('b2f', ('inot', a))), ('bcsel', a, -0.0,
-1.0)),

In at least some cases, this results in some extra load-immediate instructions

mov(16)         g16<1>D         1065353216D                     { align1 1H };
mov.nz.f0(16)   null<1>D        g8<8,8,1>D                      { align1 1H };
(-f0) sel(16)   g126<1>UD       g16<8,8,1>UD    0x00000000UD    { align1 1H };

Which also seems dumb.  This should be

mov.z.f0(16)    null<1>D        g8<8,8,1>D
(-f0) sel(16)   g126<1>F        g8<8,8,1>F     1.0F

-- 
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/20180718/e863e015/attachment-0001.html>


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