s390.c (s390_canonicalize_comparison): Prefer register over memory as first operand.

* config/s390/s390.c (s390_canonicalize_comparison): Prefer register
	over memory as first operand.

From-SVN: r103082
This commit is contained in:
Ulrich Weigand 2005-08-14 19:06:56 +00:00 committed by Ulrich Weigand
parent 7af8f00c54
commit c5b2a111dc
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-08-14 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390.c (s390_canonicalize_comparison): Prefer register
over memory as first operand.
2005-08-14 H.J. Lu <hongjiu.lu@intel.com>
PR target/23360

View File

@ -673,6 +673,13 @@ s390_canonicalize_comparison (enum rtx_code *code, rtx *op0, rtx *op1)
*code = NE;
*op0 = XEXP (*op0, 0);
}
/* Prefer register over memory as first operand. */
if (MEM_P (*op0) && REG_P (*op1))
{
rtx tem = *op0; *op0 = *op1; *op1 = tem;
*code = swap_condition (*code);
}
}
/* Emit a compare instruction suitable to implement the comparison