freedreno/ir3: eliminate unnecessary absneg's
authorRob Clark <robclark@freedesktop.org>
Tue, 5 Apr 2016 16:39:47 +0000 (12:39 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 5 Apr 2016 19:04:25 +0000 (15:04 -0400)
commitf9cdbf44054009122fcc16c887fb90ccc33b52c9
tree592fcae6b07a4a68f22ef6ddee239f0d9c2aceec
parent0daab9878d2b96356cf667591a2c877d912be52d
freedreno/ir3: eliminate unnecessary absneg's

The frontend inserts (abs) and (neg)'s to convert between NIR boolean
(~0/0) and native boolean (1/0).  So we'd end up with things like:

   cmps.s.ge r1.x, ...
   absneg.s r1.x, (neg)r1.x
   absneg.s r1.x, (abs)r1.x
   sel.b32 r2.x, r0.x, r1.x, r0.y

The (neg) already gets collapsed due to the following (abs).  Now by
realizing that r1.x comes from a cmps.s instruction, we can drop the
(abs) as well.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3.h
src/gallium/drivers/freedreno/ir3/ir3_cp.c