i965/vec4: Optimize predicate handling for any/all.
authorMatt Turner <mattst88@gmail.com>
Thu, 26 Nov 2015 05:54:30 +0000 (21:54 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 18 Dec 2015 18:20:13 +0000 (13:20 -0500)
commitbb9eb599335ec4ac3a2a579359fb239f16de17e8
tree405dae157c5f1ff1c24a05baab46017db8dfe949
parentc8a74e3a4ea6ac5dfa35adac06af14a8fa4ff773
i965/vec4: Optimize predicate handling for any/all.

For a select whose condition is any(v), instead of emitting

   cmp.nz.f0(8)    null<1>D        g1<0,4,1>D      0D
   mov(8)          g7<1>.xUD       0x00000000UD
   (+f0.any4h) mov(8) g7<1>.xUD    0xffffffffUD
   cmp.nz.f0(8)    null<1>D        g7<4,4,1>.xD    0D
   (+f0) sel(8)    g8<1>UD         g4<4,4,1>UD     g3<4,4,1>UD

we now emit

   cmp.nz.f0(8)    null<1>D        g1<0,4,1>D      0D
   (+f0.any4h) sel(8) g9<1>UD      g4<4,4,1>UD     g3<4,4,1>UD

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp