diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2005-08-14 19:06:56 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2005-08-14 19:06:56 +0000 |
commit | c5b2a111dcea3bd2e618676d2761a1570c145dcd (patch) | |
tree | b1605986e7a15db2a3d0fcf0a2ba47d4ba7bc807 /gcc | |
parent | 7af8f00c543646474396940a162866e60bf350de (diff) | |
download | gcc-c5b2a111dcea3bd2e618676d2761a1570c145dcd.zip gcc-c5b2a111dcea3bd2e618676d2761a1570c145dcd.tar.gz gcc-c5b2a111dcea3bd2e618676d2761a1570c145dcd.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f112f1b..fb92782 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index aae0479..1814ed0 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -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 |