s390.c (s390_select_ccmode): Enable using CC of x + imm for higher immediates on...
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Tue, 4 Dec 2012 14:04:39 +0000 (14:04 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 4 Dec 2012 14:04:39 +0000 (14:04 +0000)
2012-12-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

* config/s390/s390.c (s390_select_ccmode): Enable using CC of
          x + imm for higher immediates on z9-109 upwards.

From-SVN: r194141

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

index 4bd208212555081c2d8a4ab81e88b481e275f607..077191ad6b1bd658ceb57d345a5831bfc3bb8513 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * config/s390/s390.c (s390_select_ccmode): Enable using CC of
+          x + imm for higher immediates on z9-109 upwards.
+
 2012-12-04  Richard Earnshaw  <rearnsha@arm.com>
 
        * arm.opt (cirrus-fix-invalid-insns): Delete option.
index 4ce1dc9542c4b4756bf8ce1fa725b04f43c12f8b..6517bce15e0fe187e7c0af481b3db9ff3d74e116 100644 (file)
@@ -691,7 +691,10 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1)
             int a, b; if ((b = a + c) > 0)
           with c as a constant value: c < 0 -> CCAN and c >= 0 -> CCAP  */
        if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT
-           && CONST_OK_FOR_K (INTVAL (XEXP (op0, 1))))
+           && (CONST_OK_FOR_K (INTVAL (XEXP (op0, 1)))
+               || (CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'O', "Os")
+                   /* Avoid INT32_MIN on 32 bit.  */
+                   && (!TARGET_ZARCH || INTVAL (XEXP (op0, 1)) != -0x7fffffff - 1))))
          {
            if (INTVAL (XEXP((op0), 1)) < 0)
              return CCANmode;