This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [s390] patch: updating s390.c (2/4)


Hi,

this second patch substitutes several 'int' by 'bool' where appropriate.


2005-05-09  Adrian Straetling  <straetling@de.ibm.com>

	* config/s390/s390-protos.h: (s390_match_ccmode,
	s390_match_ccmode_set, reg_used_in_mem_p,
	symbolic_reference_mentioned_p, tls_symbolic_reference_mentioned_p,
	legitimate_la_operand_p, preferred_la_operand_p,
	s390_short_displacement, addr_generation_dependency_p,
	legitimate_reload_constant_p, legitimate_address_p): Change return type
	into 'bool'.
	(s390_tm_ccmode): Change type of parameter "mixed" into 'bool'. 
	* config/s390/s390.c: (s390_match_ccmode,
	symbolic_reference_mentioned_p, tls_symbolic_reference_mentioned_p,
	legitimate_reload_constant_p): Change return type into 'bool'.
	(preferred_la_operand_p,legitimate_la_operand_p, legitimate_address_p):
	Likewise. Additionally adapted comment.  
	(s390_extra_constraint_p): Change Comment to reflect 'int' return type.
	(s390_tm_ccmode): Change type of parameter "mixed" into 'bool'. 
	(s390_decompose_address): Change the type of the internal flags
	"pointer", "base_ptr", "indx_ptr", and the return value into 'bool'.
	(struct s390_address): Change type of "pointer" into bool.
	* config/s390/s390.md: ("*tmdi_reg", "*tmsi_reg", "tm<mode>_full"):
	Adapt calls for 's390_tm_ccmode' to the new signature.


Index: gcc/config/s390/s390-protos.h
===================================================================
*** gcc/config/s390/s390-protos.h.orig	2005-05-09 18:15:32.000000000 +0200
--- gcc/config/s390/s390-protos.h	2005-05-09 18:21:24.521486453 +0200
*************** extern bool s390_split_ok_p (rtx, rtx, e
*** 39,58 ****
  extern bool s390_offset_p (rtx, rtx, rtx);
  extern int tls_symbolic_operand (rtx);
  
! extern int s390_match_ccmode (rtx, enum machine_mode);
! extern enum machine_mode s390_tm_ccmode (rtx, rtx, int);
  extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx);
  extern void s390_canonicalize_comparison (enum rtx_code *, rtx *, rtx *);
  extern rtx s390_emit_compare (enum rtx_code, rtx, rtx);
  extern void s390_emit_jump (rtx, rtx);
! extern int symbolic_reference_mentioned_p (rtx);
! extern int tls_symbolic_reference_mentioned_p (rtx);
! extern int legitimate_la_operand_p (rtx);
! extern int preferred_la_operand_p (rtx, rtx);
  extern int legitimate_pic_operand_p (rtx);
  extern int legitimate_constant_p (rtx);
! extern int legitimate_reload_constant_p (rtx);
! extern int legitimate_address_p (enum machine_mode, rtx, int);
  extern rtx legitimize_pic_address (rtx, rtx);
  extern rtx legitimize_address (rtx, rtx, enum machine_mode);
  extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int);
--- 39,58 ----
  extern bool s390_offset_p (rtx, rtx, rtx);
  extern int tls_symbolic_operand (rtx);
  
! extern bool s390_match_ccmode (rtx, enum machine_mode);
! extern enum machine_mode s390_tm_ccmode (rtx, rtx, bool);
  extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx);
  extern void s390_canonicalize_comparison (enum rtx_code *, rtx *, rtx *);
  extern rtx s390_emit_compare (enum rtx_code, rtx, rtx);
  extern void s390_emit_jump (rtx, rtx);
! extern bool symbolic_reference_mentioned_p (rtx);
! extern bool tls_symbolic_reference_mentioned_p (rtx);
! extern bool legitimate_la_operand_p (rtx);
! extern bool preferred_la_operand_p (rtx, rtx);
  extern int legitimate_pic_operand_p (rtx);
  extern int legitimate_constant_p (rtx);
! extern bool legitimate_reload_constant_p (rtx);
! extern bool legitimate_address_p (enum machine_mode, rtx, int);
  extern rtx legitimize_pic_address (rtx, rtx);
  extern rtx legitimize_address (rtx, rtx, enum machine_mode);
  extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int);
Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig	2005-05-09 18:21:11.000000000 +0200
--- gcc/config/s390/s390.c	2005-05-09 18:21:59.371486453 +0200
*************** struct s390_address
*** 177,183 ****
    rtx base;
    rtx indx;
    rtx disp;
!   int pointer;
  };
  
  /* Which cpu are we tuning for.  */
--- 177,183 ----
    rtx base;
    rtx indx;
    rtx disp;
!   bool pointer;
  };
  
  /* Which cpu are we tuning for.  */
*************** struct machine_function GTY(())
*** 259,265 ****
     the source and destination have matching CC modes and that
     CC mode is at least as constrained as REQ_MODE.  */
  
! static int
  s390_match_ccmode_set (rtx set, enum machine_mode req_mode)
  {
    enum machine_mode set_mode;
--- 259,265 ----
     the source and destination have matching CC modes and that
     CC mode is at least as constrained as REQ_MODE.  */
  
! static bool
  s390_match_ccmode_set (rtx set, enum machine_mode req_mode)
  {
    enum machine_mode set_mode;
*************** s390_match_ccmode_set (rtx set, enum mac
*** 312,325 ****
     CC mode is at least as constrained as REQ_MODE.
     If REQ_MODE is VOIDmode, always return false.  */
  
! int
  s390_match_ccmode (rtx insn, enum machine_mode req_mode)
  {
    int i;
  
    /* s390_tm_ccmode returns VOIDmode to indicate failure.  */
    if (req_mode == VOIDmode)
!     return 0;
  
    if (GET_CODE (PATTERN (insn)) == SET)
      return s390_match_ccmode_set (PATTERN (insn), req_mode);
--- 312,325 ----
     CC mode is at least as constrained as REQ_MODE.
     If REQ_MODE is VOIDmode, always return false.  */
  
! bool
  s390_match_ccmode (rtx insn, enum machine_mode req_mode)
  {
    int i;
  
    /* s390_tm_ccmode returns VOIDmode to indicate failure.  */
    if (req_mode == VOIDmode)
!     return false;
  
    if (GET_CODE (PATTERN (insn)) == SET)
      return s390_match_ccmode_set (PATTERN (insn), req_mode);
*************** s390_match_ccmode (rtx insn, enum machin
*** 330,339 ****
            rtx set = XVECEXP (PATTERN (insn), 0, i);
            if (GET_CODE (set) == SET)
              if (!s390_match_ccmode_set (set, req_mode))
!               return 0;
          }
  
!   return 1;
  }
  
  /* If a test-under-mask instruction can be used to implement
--- 330,339 ----
            rtx set = XVECEXP (PATTERN (insn), 0, i);
            if (GET_CODE (set) == SET)
              if (!s390_match_ccmode_set (set, req_mode))
!               return false;
          }
  
!   return true;
  }
  
  /* If a test-under-mask instruction can be used to implement
*************** s390_match_ccmode (rtx insn, enum machin
*** 344,350 ****
     if the instruction cannot (TM).  */
  
  enum machine_mode
! s390_tm_ccmode (rtx op1, rtx op2, int mixed)
  {
    int bit0, bit1;
  
--- 344,350 ----
     if the instruction cannot (TM).  */
  
  enum machine_mode
! s390_tm_ccmode (rtx op1, rtx op2, bool mixed)
  {
    int bit0, bit1;
  
*************** s390_safe_attr_type (rtx insn)
*** 1243,1254 ****
  
  /* Return true if DISP is a valid short displacement.  */
  
! static int
  s390_short_displacement (rtx disp)
  {
    /* No displacement is OK.  */
    if (!disp)
!     return 1;
  
    /* Integer displacement in range.  */
    if (GET_CODE (disp) == CONST_INT)
--- 1243,1254 ----
  
  /* Return true if DISP is a valid short displacement.  */
  
! static bool
  s390_short_displacement (rtx disp)
  {
    /* No displacement is OK.  */
    if (!disp)
!     return true;
  
    /* Integer displacement in range.  */
    if (GET_CODE (disp) == CONST_INT)
*************** s390_short_displacement (rtx disp)
*** 1259,1278 ****
        && GET_CODE (XEXP (disp, 0)) == UNSPEC
        && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT
            || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF))
!     return 0;
  
    /* All other symbolic constants are literal pool references,
       which are OK as the literal pool must be small.  */
    if (GET_CODE (disp) == CONST)
!     return 1;
  
!   return 0;
  }
  
  /* Decompose a RTL expression ADDR for a memory address into
     its components, returned in OUT.
  
!    Returns 0 if ADDR is not a valid memory address, nonzero
     otherwise.  If OUT is NULL, don't return the components,
     but check for validity only.
  
--- 1259,1278 ----
        && GET_CODE (XEXP (disp, 0)) == UNSPEC
        && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT
            || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF))
!     return false;
  
    /* All other symbolic constants are literal pool references,
       which are OK as the literal pool must be small.  */
    if (GET_CODE (disp) == CONST)
!     return true;
  
!   return false;
  }
  
  /* Decompose a RTL expression ADDR for a memory address into
     its components, returned in OUT.
  
!    Returns false if ADDR is not a valid memory address, true
     otherwise.  If OUT is NULL, don't return the components,
     but check for validity only.
  
*************** s390_decompose_address (register rtx add
*** 1288,1296 ****
    rtx indx = NULL_RTX;
    rtx disp = NULL_RTX;
    rtx orig_disp;
!   int pointer = FALSE;
!   int base_ptr = FALSE;
!   int indx_ptr = FALSE;
  
    /* Decompose address into base + index + displacement.  */
  
--- 1288,1296 ----
    rtx indx = NULL_RTX;
    rtx disp = NULL_RTX;
    rtx orig_disp;
!   bool pointer = false;
!   bool base_ptr = false;
!   bool indx_ptr = false;
  
    /* Decompose address into base + index + displacement.  */
  
*************** s390_decompose_address (register rtx add
*** 1328,1334 ****
  
        else
  	{
! 	  return FALSE;
  	}
      }
  
--- 1328,1334 ----
  
        else
  	{
! 	  return false;
  	}
      }
  
*************** s390_decompose_address (register rtx add
*** 1367,1373 ****
        else if (!indx)
          indx = gen_rtx_REG (Pmode, BASE_REGNUM);
        else
!         return FALSE;
  
        /* Mark up the displacement.  */
        disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp),
--- 1367,1373 ----
        else if (!indx)
          indx = gen_rtx_REG (Pmode, BASE_REGNUM);
        else
!         return false;
  
        /* Mark up the displacement.  */
        disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp),
*************** s390_decompose_address (register rtx add
*** 1386,1392 ****
  				     gen_rtvec (1, XVECEXP (base, 0, 0)),
  				     UNSPEC_LTREL_OFFSET);
  	    else
! 	      return FALSE;
  
  	    base = gen_rtx_REG (Pmode, BASE_REGNUM);
  	    break;
--- 1386,1392 ----
  				     gen_rtvec (1, XVECEXP (base, 0, 0)),
  				     UNSPEC_LTREL_OFFSET);
  	    else
! 	      return false;
  
  	    base = gen_rtx_REG (Pmode, BASE_REGNUM);
  	    break;
*************** s390_decompose_address (register rtx add
*** 1396,1406 ****
  	    break;
  
  	  default:
! 	    return FALSE;
  	  }
  
        if (GET_CODE (base) != REG || GET_MODE (base) != Pmode)
! 	return FALSE;
  
        if (REGNO (base) == BASE_REGNUM
  	  || REGNO (base) == STACK_POINTER_REGNUM
--- 1396,1406 ----
  	    break;
  
  	  default:
! 	    return false;
  	  }
  
        if (GET_CODE (base) != REG || GET_MODE (base) != Pmode)
! 	return false;
  
        if (REGNO (base) == BASE_REGNUM
  	  || REGNO (base) == STACK_POINTER_REGNUM
*************** s390_decompose_address (register rtx add
*** 1411,1417 ****
  	  || REGNO (base) == ARG_POINTER_REGNUM
            || (flag_pic
                && REGNO (base) == PIC_OFFSET_TABLE_REGNUM))
!         pointer = base_ptr = TRUE;
      }
  
    /* Validate index register.  */
--- 1411,1417 ----
  	  || REGNO (base) == ARG_POINTER_REGNUM
            || (flag_pic
                && REGNO (base) == PIC_OFFSET_TABLE_REGNUM))
!         pointer = base_ptr = true;
      }
  
    /* Validate index register.  */
*************** s390_decompose_address (register rtx add
*** 1426,1432 ****
  				     gen_rtvec (1, XVECEXP (indx, 0, 0)),
  				     UNSPEC_LTREL_OFFSET);
  	    else
! 	      return FALSE;
  
  	    indx = gen_rtx_REG (Pmode, BASE_REGNUM);
  	    break;
--- 1426,1432 ----
  				     gen_rtvec (1, XVECEXP (indx, 0, 0)),
  				     UNSPEC_LTREL_OFFSET);
  	    else
! 	      return false;
  
  	    indx = gen_rtx_REG (Pmode, BASE_REGNUM);
  	    break;
*************** s390_decompose_address (register rtx add
*** 1436,1446 ****
  	    break;
  
  	  default:
! 	    return FALSE;
  	  }
  
        if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode)
! 	return FALSE;
  
        if (REGNO (indx) == BASE_REGNUM
  	  || REGNO (indx) == STACK_POINTER_REGNUM
--- 1436,1446 ----
  	    break;
  
  	  default:
! 	    return false;
  	  }
  
        if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode)
! 	return false;
  
        if (REGNO (indx) == BASE_REGNUM
  	  || REGNO (indx) == STACK_POINTER_REGNUM
*************** s390_decompose_address (register rtx add
*** 1451,1457 ****
  	  || REGNO (indx) == ARG_POINTER_REGNUM
            || (flag_pic
                && REGNO (indx) == PIC_OFFSET_TABLE_REGNUM))
!         pointer = indx_ptr = TRUE;
      }
  
    /* Prefer to use pointer as base, not index.  */
--- 1451,1457 ----
  	  || REGNO (indx) == ARG_POINTER_REGNUM
            || (flag_pic
                && REGNO (indx) == PIC_OFFSET_TABLE_REGNUM))
!         pointer = indx_ptr = true;
      }
  
    /* Prefer to use pointer as base, not index.  */
*************** s390_decompose_address (register rtx add
*** 1480,1491 ****
  	  && base != return_address_pointer_rtx 
  	  && indx != return_address_pointer_rtx)
  	if (!DISP_IN_RANGE (offset))
! 	  return FALSE;
      }
    else
      {
        /* All the special cases are pointers.  */
!       pointer = TRUE;
  
        /* In the small-PIC case, the linker converts @GOT
           and @GOTNTPOFF offsets to possible displacements.  */
--- 1480,1491 ----
  	  && base != return_address_pointer_rtx 
  	  && indx != return_address_pointer_rtx)
  	if (!DISP_IN_RANGE (offset))
! 	  return false;
      }
    else
      {
        /* All the special cases are pointers.  */
!       pointer = true;
  
        /* In the small-PIC case, the linker converts @GOT
           and @GOTNTPOFF offsets to possible displacements.  */
*************** s390_decompose_address (register rtx add
*** 1517,1534 ****
  		 exceed the size of the constant pool entry.  */
  	      rtx sym = XVECEXP (disp, 0, 0);
  	      if (offset >= GET_MODE_SIZE (get_pool_mode (sym)))
! 		return FALSE;
  
                orig_disp = plus_constant (orig_disp, offset);
  	    }
          }
  
        else
! 	return FALSE;
      }
  
    if (!base && !indx)
!     pointer = TRUE;
  
    if (out)
      {
--- 1517,1534 ----
  		 exceed the size of the constant pool entry.  */
  	      rtx sym = XVECEXP (disp, 0, 0);
  	      if (offset >= GET_MODE_SIZE (get_pool_mode (sym)))
! 		return false;
  
                orig_disp = plus_constant (orig_disp, offset);
  	    }
          }
  
        else
! 	return false;
      }
  
    if (!base && !indx)
!     pointer = true;
  
    if (out)
      {
*************** s390_decompose_address (register rtx add
*** 1538,1544 ****
        out->pointer = pointer;
      }
  
!   return TRUE;
  }
  
  /* Return true if CODE is a valid address without index.  */
--- 1538,1544 ----
        out->pointer = pointer;
      }
  
!   return true;
  }
  
  /* Return true if CODE is a valid address without index.  */
*************** s390_legitimate_address_without_index_p 
*** 1556,1562 ****
    return true;
  }
  
! /* Return true if OP is a valid operand for a C constraint.  */
  
  int
  s390_extra_constraint_str (rtx op, int c, const char * str)
--- 1556,1562 ----
    return true;
  }
  
! /* Return 1 if OP is a valid operand for a C constraint, 0 else.  */
  
  int
  s390_extra_constraint_str (rtx op, int c, const char * str)
*************** s390_split_access_reg (rtx reg, rtx *lo,
*** 1996,2002 ****
  
  /* Return true if OP contains a symbol reference */
  
! int
  symbolic_reference_mentioned_p (rtx op)
  {
    register const char *fmt;
--- 1996,2002 ----
  
  /* Return true if OP contains a symbol reference */
  
! bool
  symbolic_reference_mentioned_p (rtx op)
  {
    register const char *fmt;
*************** symbolic_reference_mentioned_p (rtx op)
*** 2026,2032 ****
  
  /* Return true if OP contains a reference to a thread-local symbol.  */
  
! int
  tls_symbolic_reference_mentioned_p (rtx op)
  {
    register const char *fmt;
--- 2026,2032 ----
  
  /* Return true if OP contains a reference to a thread-local symbol.  */
  
! bool
  tls_symbolic_reference_mentioned_p (rtx op)
  {
    register const char *fmt;
*************** tls_symbolic_reference_mentioned_p (rtx 
*** 2044,2057 ****
  
  	  for (j = XVECLEN (op, i) - 1; j >= 0; j--)
  	    if (tls_symbolic_reference_mentioned_p (XVECEXP (op, i, j)))
! 	      return 1;
  	}
  
        else if (fmt[i] == 'e' && tls_symbolic_reference_mentioned_p (XEXP (op, i)))
! 	return 1;
      }
  
!   return 0;
  }
  
  
--- 2044,2057 ----
  
  	  for (j = XVECLEN (op, i) - 1; j >= 0; j--)
  	    if (tls_symbolic_reference_mentioned_p (XVECEXP (op, i, j)))
! 	      return true;
  	}
  
        else if (fmt[i] == 'e' && tls_symbolic_reference_mentioned_p (XEXP (op, i)))
! 	return true;
      }
  
!   return false;
  }
  
  
*************** s390_cannot_force_const_mem (rtx x)
*** 2172,2202 ****
     a constant that would need to be forced to the literal pool
     before it can be used as operand.  */
  
! int
  legitimate_reload_constant_p (register rtx op)
  {
    /* Accept la(y) operands.  */
    if (GET_CODE (op) == CONST_INT
        && DISP_IN_RANGE (INTVAL (op)))
!     return 1;
  
    /* Accept l(g)hi operands.  */
    if (GET_CODE (op) == CONST_INT
        && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', "K"))
!     return 1;
  
    /* Accept lliXX operands.  */
    if (TARGET_ZARCH
        && s390_single_part (op, DImode, HImode, 0) >= 0)
!   return 1;
  
    /* Accept larl operands.  */
    if (TARGET_CPU_ZARCH
        && larl_operand (op, VOIDmode))
!     return 1;
  
    /* Everything else cannot be handled without reload.  */
!   return 0;
  }
  
  /* Given an rtx OP being reloaded into a reg required to be in class CLASS,
--- 2172,2202 ----
     a constant that would need to be forced to the literal pool
     before it can be used as operand.  */
  
! bool
  legitimate_reload_constant_p (register rtx op)
  {
    /* Accept la(y) operands.  */
    if (GET_CODE (op) == CONST_INT
        && DISP_IN_RANGE (INTVAL (op)))
!     return true;
  
    /* Accept l(g)hi operands.  */
    if (GET_CODE (op) == CONST_INT
        && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', "K"))
!     return true;
  
    /* Accept lliXX operands.  */
    if (TARGET_ZARCH
        && s390_single_part (op, DImode, HImode, 0) >= 0)
!   return true;
  
    /* Accept larl operands.  */
    if (TARGET_CPU_ZARCH
        && larl_operand (op, VOIDmode))
!     return true;
  
    /* Everything else cannot be handled without reload.  */
!   return false;
  }
  
  /* Given an rtx OP being reloaded into a reg required to be in class CLASS,
*************** s390_expand_plus_operand (register rtx t
*** 2343,2398 ****
  }
  
  
! /* Return nonzero if ADDR is a valid memory address.
     STRICT specifies whether strict register checking applies.  */
  
! int
  legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
  		      register rtx addr, int strict)
  {
    struct s390_address ad;
    if (!s390_decompose_address (addr, &ad))
!     return FALSE;
  
    if (strict)
      {
        if (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base))
! 	return FALSE;
        if (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))
! 	return FALSE;
      }
    else
      {
        if (ad.base && !REG_OK_FOR_BASE_NONSTRICT_P (ad.base))
! 	return FALSE;
        if (ad.indx && !REG_OK_FOR_INDEX_NONSTRICT_P (ad.indx))
! 	return FALSE;
      }
  
!   return TRUE;
  }
  
! /* Return 1 if OP is a valid operand for the LA instruction.
     In 31-bit, we need to prove that the result is used as an
     address, as LA performs only a 31-bit addition.  */
  
! int
  legitimate_la_operand_p (register rtx op)
  {
    struct s390_address addr;
    if (!s390_decompose_address (op, &addr))
!     return FALSE;
! 
!   if (TARGET_64BIT || addr.pointer)
!     return TRUE;
  
!   return FALSE;
  }
  
! /* Return 1 if it is valid *and* preferable to use LA to
     compute the sum of OP1 and OP2.  */
  
! int
  preferred_la_operand_p (rtx op1, rtx op2)
  {
    struct s390_address addr;
--- 2343,2395 ----
  }
  
  
! /* Return true if ADDR is a valid memory address.
     STRICT specifies whether strict register checking applies.  */
  
! bool
  legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
  		      register rtx addr, int strict)
  {
    struct s390_address ad;
    if (!s390_decompose_address (addr, &ad))
!     return false;
  
    if (strict)
      {
        if (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base))
! 	return false;
        if (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx))
! 	return false;
      }
    else
      {
        if (ad.base && !REG_OK_FOR_BASE_NONSTRICT_P (ad.base))
! 	return false;
        if (ad.indx && !REG_OK_FOR_INDEX_NONSTRICT_P (ad.indx))
! 	return false;
      }
  
!   return true;
  }
  
! /* Return true if OP is a valid operand for the LA instruction.
     In 31-bit, we need to prove that the result is used as an
     address, as LA performs only a 31-bit addition.  */
  
! bool
  legitimate_la_operand_p (register rtx op)
  {
    struct s390_address addr;
    if (!s390_decompose_address (op, &addr))
!     return false;
  
!   return (TARGET_64BIT || addr.pointer);
  }
  
! /* Return true if it is valid *and* preferable to use LA to
     compute the sum of OP1 and OP2.  */
  
! bool
  preferred_la_operand_p (rtx op1, rtx op2)
  {
    struct s390_address addr;
*************** preferred_la_operand_p (rtx op1, rtx op2
*** 2401,2423 ****
      op1 = gen_rtx_PLUS (Pmode, op1, op2);
  
    if (!s390_decompose_address (op1, &addr))
!     return FALSE;
    if (addr.base && !REG_OK_FOR_BASE_STRICT_P (addr.base))
!     return FALSE;
    if (addr.indx && !REG_OK_FOR_INDEX_STRICT_P (addr.indx))
!     return FALSE;
  
    if (!TARGET_64BIT && !addr.pointer)
!     return FALSE;
  
    if (addr.pointer)
!     return TRUE;
  
    if ((addr.base && REG_P (addr.base) && REG_POINTER (addr.base))
        || (addr.indx && REG_P (addr.indx) && REG_POINTER (addr.indx)))
!     return TRUE;
  
!   return FALSE;
  }
  
  /* Emit a forced load-address operation to load SRC into DST.
--- 2398,2420 ----
      op1 = gen_rtx_PLUS (Pmode, op1, op2);
  
    if (!s390_decompose_address (op1, &addr))
!     return false;
    if (addr.base && !REG_OK_FOR_BASE_STRICT_P (addr.base))
!     return false;
    if (addr.indx && !REG_OK_FOR_INDEX_STRICT_P (addr.indx))
!     return false;
  
    if (!TARGET_64BIT && !addr.pointer)
!     return false;
  
    if (addr.pointer)
!     return true;
  
    if ((addr.base && REG_P (addr.base) && REG_POINTER (addr.base))
        || (addr.indx && REG_P (addr.indx) && REG_POINTER (addr.indx)))
!     return true;
  
!   return false;
  }
  
  /* Emit a forced load-address operation to load SRC into DST.
*************** s390_assemble_integer (rtx x, unsigned i
*** 3950,3956 ****
  /* Returns true if register REGNO is used  for forming
     a memory address in expression X.  */
  
! static int
  reg_used_in_mem_p (int regno, rtx x)
  {
    enum rtx_code code = GET_CODE (x);
--- 3947,3953 ----
  /* Returns true if register REGNO is used  for forming
     a memory address in expression X.  */
  
! static bool
  reg_used_in_mem_p (int regno, rtx x)
  {
    enum rtx_code code = GET_CODE (x);
*************** reg_used_in_mem_p (int regno, rtx x)
*** 3961,3974 ****
      {
        if (refers_to_regno_p (regno, regno+1,
  			     XEXP (x, 0), 0))
! 	return 1;
      }
    else if (code == SET
  	   && GET_CODE (SET_DEST (x)) == PC)
      {
        if (refers_to_regno_p (regno, regno+1,
  			     SET_SRC (x), 0))
! 	return 1;
      }
  
    fmt = GET_RTX_FORMAT (code);
--- 3958,3971 ----
      {
        if (refers_to_regno_p (regno, regno+1,
  			     XEXP (x, 0), 0))
! 	return true;
      }
    else if (code == SET
  	   && GET_CODE (SET_DEST (x)) == PC)
      {
        if (refers_to_regno_p (regno, regno+1,
  			     SET_SRC (x), 0))
! 	return true;
      }
  
    fmt = GET_RTX_FORMAT (code);
*************** reg_used_in_mem_p (int regno, rtx x)
*** 3976,3995 ****
      {
        if (fmt[i] == 'e'
  	  && reg_used_in_mem_p (regno, XEXP (x, i)))
! 	return 1;
  
        else if (fmt[i] == 'E')
  	for (j = 0; j < XVECLEN (x, i); j++)
  	  if (reg_used_in_mem_p (regno, XVECEXP (x, i, j)))
! 	    return 1;
      }
!   return 0;
  }
  
  /* Returns true if expression DEP_RTX sets an address register
     used by instruction INSN to address memory.  */
  
! static int
  addr_generation_dependency_p (rtx dep_rtx, rtx insn)
  {
    rtx target, pat;
--- 3973,3992 ----
      {
        if (fmt[i] == 'e'
  	  && reg_used_in_mem_p (regno, XEXP (x, i)))
! 	return true;
  
        else if (fmt[i] == 'E')
  	for (j = 0; j < XVECLEN (x, i); j++)
  	  if (reg_used_in_mem_p (regno, XVECEXP (x, i, j)))
! 	    return true;
      }
!   return false;
  }
  
  /* Returns true if expression DEP_RTX sets an address register
     used by instruction INSN to address memory.  */
  
! static bool
  addr_generation_dependency_p (rtx dep_rtx, rtx insn)
  {
    rtx target, pat;
*************** addr_generation_dependency_p (rtx dep_rt
*** 4027,4033 ****
  	    return reg_used_in_mem_p (regno, PATTERN (insn));
  	}
      }
!   return 0;
  }
  
  /* Return 1, if dep_insn sets register used in insn in the agen unit.  */
--- 4024,4030 ----
  	    return reg_used_in_mem_p (regno, PATTERN (insn));
  	}
      }
!   return false;
  }
  
  /* Return 1, if dep_insn sets register used in insn in the agen unit.  */
Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md.orig	2005-05-09 18:15:32.000000000 +0200
--- gcc/config/s390/s390.md	2005-05-09 18:21:24.571486453 +0200
***************
*** 364,370 ****
          (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S")
                           (match_operand:QI 1 "immediate_operand" "n,n"))
                   (match_operand:QI 2 "immediate_operand" "n,n")))]
!   "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
    "@
     tm\t%S0,%b1
     tmy\t%S0,%b1"
--- 364,370 ----
          (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S")
                           (match_operand:QI 1 "immediate_operand" "n,n"))
                   (match_operand:QI 2 "immediate_operand" "n,n")))]
!   "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], false))"
    "@
     tm\t%S0,%b1
     tmy\t%S0,%b1"
***************
*** 377,383 ****
  					     "N0HD0,N1HD0,N2HD0,N3HD0"))
                   (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
    "TARGET_64BIT
!    && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
     && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
    "@
     tmhh\t%0,%i1
--- 377,383 ----
  					     "N0HD0,N1HD0,N2HD0,N3HD0"))
                   (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
    "TARGET_64BIT
!    && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true))
     && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
    "@
     tmhh\t%0,%i1
***************
*** 391,397 ****
          (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
                           (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
                   (match_operand:SI 2 "immediate_operand" "n,n")))]
!   "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
     && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
    "@
     tmh\t%0,%i1
--- 391,397 ----
          (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
                           (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
                   (match_operand:SI 2 "immediate_operand" "n,n")))]
!   "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true))
     && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
    "@
     tmh\t%0,%i1
***************
*** 402,408 ****
    [(set (reg CC_REGNUM)
          (compare (match_operand:HQI 0 "register_operand" "d")
                   (match_operand:HQI 1 "immediate_operand" "n")))]
!   "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
    "tml\t%0,<max_uint>"
    [(set_attr "op_type" "RI")])
  
--- 402,408 ----
    [(set (reg CC_REGNUM)
          (compare (match_operand:HQI 0 "register_operand" "d")
                   (match_operand:HQI 1 "immediate_operand" "n")))]
!   "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], true))"
    "tml\t%0,<max_uint>"
    [(set_attr "op_type" "RI")])
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]