[committed] VECTOR_MODE_P cleanup

Aldy Hernandez aldyh@redhat.com
Fri Jun 13 19:48:00 GMT 2003


We should really be using the macros.

Committed as obvious.

2003-06-13  Aldy Hernandez  <aldyh@redhat.com>

	* c-common.c (handle_mode_attribute): Use VECTOR_MODE_P macro.

	* simplify-rtx.c (simplify_subreg): Same.

	* emit-rtl.c (gen_lowpart_common): Same.

Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.418
diff -c -p -r1.418 c-common.c
*** c-common.c	4 Jun 2003 17:05:52 -0000	1.418
--- c-common.c	13 Jun 2003 19:21:23 -0000
*************** handle_mode_attribute (node, name, args,
*** 5215,5223 ****
   	{
   	  /* If this is a vector, make sure we either have hardware
   	     support, or we can emulate it.  */
! 	  if ((GET_MODE_CLASS (mode) == MODE_VECTOR_INT
! 	       || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
! 	      && !vector_mode_valid_p (mode))
   	    {
   	      error ("unable to emulate '%s'", GET_MODE_NAME (mode));
   	      return NULL_TREE;
--- 5215,5221 ----
   	{
   	  /* If this is a vector, make sure we either have hardware
   	     support, or we can emulate it.  */
! 	  if (VECTOR_MODE_P (mode) && !vector_mode_valid_p (mode))
   	    {
   	      error ("unable to emulate '%s'", GET_MODE_NAME (mode));
   	      return NULL_TREE;
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.141
diff -c -p -r1.141 simplify-rtx.c
*** simplify-rtx.c	3 May 2003 23:12:41 -0000	1.141
--- simplify-rtx.c	13 Jun 2003 19:21:25 -0000
*************** simplify_subreg (outermode, op, innermod
*** 2707,2714 ****
         int offset, part;
         unsigned HOST_WIDE_INT val = 0;

!       if (GET_MODE_CLASS (outermode) == MODE_VECTOR_INT
! 	  || GET_MODE_CLASS (outermode) == MODE_VECTOR_FLOAT)
   	{
   	  /* Construct a CONST_VECTOR from individual subregs.  */
   	  enum machine_mode submode = GET_MODE_INNER (outermode);
--- 2707,2713 ----
         int offset, part;
         unsigned HOST_WIDE_INT val = 0;

!       if (VECTOR_MODE_P (outermode))
   	{
   	  /* Construct a CONST_VECTOR from individual subregs.  */
   	  enum machine_mode submode = GET_MODE_INNER (outermode);
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.330
diff -c -p -r1.330 emit-rtl.c
*** emit-rtl.c	8 Jun 2003 19:35:51 -0000	1.330
--- emit-rtl.c	13 Jun 2003 19:21:28 -0000
*************** gen_lowpart_common (mode, x)
*** 1155,1163 ****
     else if (GET_CODE (x) == SUBREG || GET_CODE (x) == REG
   	   || GET_CODE (x) == CONCAT || GET_CODE (x) == CONST_VECTOR)
       return simplify_gen_subreg (mode, x, GET_MODE (x), offset);
!   else if ((GET_MODE_CLASS (mode) == MODE_VECTOR_INT
! 	    || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
! 	   && GET_MODE (x) == VOIDmode)
       return simplify_gen_subreg (mode, x, int_mode_for_mode (mode), 
offset);
     /* If X is a CONST_INT or a CONST_DOUBLE, extract the appropriate 
bits
        from the low-order part of the constant.  */
--- 1155,1161 ----
     else if (GET_CODE (x) == SUBREG || GET_CODE (x) == REG
   	   || GET_CODE (x) == CONCAT || GET_CODE (x) == CONST_VECTOR)
       return simplify_gen_subreg (mode, x, GET_MODE (x), offset);
!   else if (VECTOR_MODE_P (mode) && GET_MODE (x) == VOIDmode)
       return simplify_gen_subreg (mode, x, int_mode_for_mode (mode), 
offset);
     /* If X is a CONST_INT or a CONST_DOUBLE, extract the appropriate 
bits
        from the low-order part of the constant.  */



More information about the Gcc-patches mailing list