pan/midgard: not(a) == not(b) should optimize to a == b
Add a new pass to midgard_opt_invert. When faced with an ieq instruction (or others?), we can optimize out not's.
Good dip-your-toe-in task for the compiler.
Test case: dEQP-GLES2.functional.shaders.operator.bool_compare.equal.bvec4_fragment
We currently compile to:
ld_vary_32 r0, 0, 0x9E, 0x1E /* A0 */
vmul.fle r24, r0.yzwx, #0
vadd.inor r0, sext(r24), #0
ld_vary_32 r1, 1, 0x9E, 0x1E /* A0 */
vmul.fle r24, r1.wzyx, #0
vadd.inor r1, sext(r24), #0
vmul.ieq r24, r0, r1
With this optimization, we will compile to:
ld_vary_32 r0, 0, 0x9E, 0x1E /* A0 */
ld_vary_32 r1, 1, 0x9E, 0x1E /* A0 */
vmul.fle r0, r0.yzwx, #0
vadd.fle r1, r1.wzyx, #0
vmul.ieq r24, r0, r1