[Committed] S/390: Enable CCAmode for more adds on z9

Andreas Krebbel krebbel@linux.vnet.ibm.com
Tue Dec 4 14:04:00 GMT 2012


Hi,

I've committed the attached patch which enables the CC of x+constant
instructions to be used in more situations on z9 or higher.

No regressions on s390 and s390x (--with-arch=z196).

Bye,

-Andreas-

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.

---
 gcc/config/s390/s390.c |    5 !!!!!
 1 file changed, 5 modifications(!)

Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_select_ccmode (enum rtx_code code, 
*** 691,697 ****
   	     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))))
  	  {
  	    if (INTVAL (XEXP((op0), 1)) < 0)
  	      return CCANmode;
--- 691,700 ----
   	     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_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;



More information about the Gcc-patches mailing list