OSDN Git Service

* config/s390/s390.c (s390_canonicalize_comparison): Prefer register
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Aug 2005 19:06:56 +0000 (19:06 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 14 Aug 2005 19:06:56 +0000 (19:06 +0000)
over memory as first operand.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103082 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/s390/s390.c

index f112f1b..fb92782 100644 (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
index aae0479..1814ed0 100644 (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