When copy propagating a value into an instruction that negates its
argument, we need to invert the sense of the value's "negate" flag, so
that -(+x) becomes -x and -(-x) becomes +x.
Previously, we were always setting the value's "negate" flag to true
in this circumstance, so that both -(+x) and -(-x) turned into -x.
Fixes Piglit test vs-double-negative.shader_test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
value.abs = true;
}
if (inst->src[arg].negate)
- value.negate = true;
+ value.negate = !value.negate;
/* FINISHME: We can't copy-propagate things that aren't normal
* vec8s into gen6 math instructions, because of the weird src