i915: Optimize SEQ and SNE when two operands are uniforms
i915: Optimize SEQ and SNE when two operands are uniforms

SEQ and SNE are not native i915 instructions, so they each generate at
least 3 instructions.  If both operands are uniforms or constants, we
get 5 instructions like:

                U[1] = MOV CONST[1]
                U[0].xyz = SGE CONST[0].xxxx, U[1]
                U[1] = MOV CONST[1].-x-y-z-w
                R[0].xyz = SGE CONST[0].-x-x-x-x, U[1]
                R[0].xyz = MUL R[0], U[0]

This code is stupid.  Instead of having the individual calls to
i915_emit_arith generate the moves to utemps, do it in the caller.  This
results in code like:

                U[1] = MOV CONST[1]
                U[0].xyz = SGE CONST[0].xxxx, U[1]
                R[0].xyz = SGE CONST[0].-x-x-x-x, U[1].-x-y-z-w
                R[0].xyz = MUL R[0], U[0]

This allows fs-temp-array-mat2-index-col-wr and
fs-temp-array-mat2-index-row-wr to fit in hardware limits (instead of
falling back to software rasterization).

NOTE: Without pending patches to the piglit tests, these tests will now
fail.  This is an unrelated, pre-existing issue.

v2: Copy most of the body of the commit message into comments in the
code.  Suggested by Eric.

Signed-off-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>

wolf96/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,mcanthony/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,metora/MesaGLSLCompiler,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer