i965: Use ~0 to represent true on all generations.
authorMatt Turner <mattst88@gmail.com>
Tue, 2 Dec 2014 20:28:13 +0000 (12:28 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 5 Dec 2014 17:49:42 +0000 (09:49 -0800)
commit2881b123d00562fee8b7d2b4f7825f89a73e0d9f
treee89036c38d6dcd5a89858711319a1a91fb0041ca
parent05e2578cac608ba703d188fdff4903b92dec4aed
i965: Use ~0 to represent true on all generations.

Jason realized that we could fix the result of the CMP instruction on
Gen <= 5 by doing -(result & 1). Also do the resolves in the vec4
backend before use, rather than when the bool was created. The FS does
this and it saves some unnecessary resolves.

On Ironlake:

total instructions in shared programs: 4289762 -> 4287277 (-0.06%)
instructions in affected programs:     619430 -> 616945 (-0.40%)

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp