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]

Re: mn10300/AM33: Simplify movqi patterns


On Apr 26, 2000, Jeffrey A Law <law@cygnus.com> wrote:

> Note that you collapsed I->a into the I->d*x case, which looks like
> a harmless simplification.  However, when you look at the cc status
> bits you'll find that you took a "none_0hit" for the I->a case and
> turned it into a "clobber" which could potentially lose some
> optimizations.

Yep, I actually intended to *remove* the I->a case, since `clr a#' is
more costly than `mov 0,a#'.  I had noticed this just after posting
the patch, and I think I've posted a note that I'd fix the patch
before checking it in, but it may have been only to the
Cygnus-internal mailing list.

Here's the patch I'm checking in, and the updated size changes:

v mn10300-elf/am33/libio/libio.a 23772 23763
v mn10300-elf/am33/libio/libiostream.a 64999 64872
v mn10300-elf/am33/libstdc++/libstdc++.a 70837 70710
v mn10300-elf/am33/newlib/libc.a 47573 47533
v mn10300-elf/am33/newlib/libc/libc.a 46127 46087
v mn10300-elf/am33/newlib/libc/stdio/lib.a 16931 16922
v mn10300-elf/am33/newlib/libc/stdlib/lib.a 20333 20302
v mn10300-elf/am33/newlib/libg.a 47573 47533

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@cygnus.com>

	* config/mn10300/mn10300.md (movqi): Simplify.  Prefer data
	registers.

Index: gcc/config/mn10300/mn10300.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mn10300/mn10300.md,v
retrieving revision 1.31
diff -u -c -r1.31 mn10300.md
*** gcc/config/mn10300/mn10300.md	2000/04/26 00:09:52	1.31
--- gcc/config/mn10300/mn10300.md	2000/04/27 14:42:27
***************
*** 56,63 ****
  }")
  
  (define_insn ""
!   [(set (match_operand:QI 0 "general_operand" "=dx,a,dx,a,dx,a,dx,a,dxa,m")
! 	(match_operand:QI 1 "general_operand" "0,0,I,I,a,dx,dxi,ia,m,dxa"))]
    "TARGET_AM33
     && (register_operand (operands[0], QImode)
         || register_operand (operands[1], QImode))"
--- 56,63 ----
  }")
  
  (define_insn ""
!   [(set (match_operand:QI 0 "general_operand" "=d*x*a,d*x,d*x*a,d*x*a,m")
! 	(match_operand:QI 1 "general_operand" "0,I,d*xai,m,d*xa"))]
    "TARGET_AM33
     && (register_operand (operands[0], QImode)
         || register_operand (operands[1], QImode))"
***************
*** 66,80 ****
    switch (which_alternative)
      {
      case 0:
-     case 1:
        return \"nop\";
!     case 2:
        return \"clr %0\";
!     case 3:
!     case 4:
!     case 5:
!     case 6:
!     case 7:
        if (GET_CODE (operands[1]) == CONST_DOUBLE)
  	{
  	  rtx xoperands[2];
--- 66,75 ----
    switch (which_alternative)
      {
      case 0:
        return \"nop\";
!     case 1:
        return \"clr %0\";
!     case 2:
        if (GET_CODE (operands[1]) == CONST_DOUBLE)
  	{
  	  rtx xoperands[2];
***************
*** 94,111 ****
  	    return \"movu %1,%0\";
  	}
        return \"mov %1,%0\";
!     case 8:
!     case 9:
        return \"movbu %1,%0\";
      default:
        abort ();
      }
  }"
!   [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
  
  (define_insn ""
!   [(set (match_operand:QI 0 "general_operand" "=dx,*a,dx,*a,dx,*a,dx,*a,dx,m")
! 	(match_operand:QI 1 "general_operand" "0,0,I,I,a,dx,dxi,ia,m,dx"))]
    "register_operand (operands[0], QImode)
     || register_operand (operands[1], QImode)"
    "*
--- 89,106 ----
  	    return \"movu %1,%0\";
  	}
        return \"mov %1,%0\";
!     case 3:
!     case 4:
        return \"movbu %1,%0\";
      default:
        abort ();
      }
  }"
!   [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
  
  (define_insn ""
!   [(set (match_operand:QI 0 "general_operand" "=d*a,d,d*a,d,m")
! 	(match_operand:QI 1 "general_operand" "0,I,dai,m,d"))]
    "register_operand (operands[0], QImode)
     || register_operand (operands[1], QImode)"
    "*
***************
*** 113,127 ****
    switch (which_alternative)
      {
      case 0:
-     case 1:
        return \"nop\";
!     case 2:
        return \"clr %0\";
!     case 3:
!     case 4:
!     case 5:
!     case 6:
!     case 7:
        if (GET_CODE (operands[1]) == CONST_DOUBLE)
  	{
  	  rtx xoperands[2];
--- 108,117 ----
    switch (which_alternative)
      {
      case 0:
        return \"nop\";
!     case 1:
        return \"clr %0\";
!     case 2:
        if (GET_CODE (operands[1]) == CONST_DOUBLE)
  	{
  	  rtx xoperands[2];
***************
*** 132,145 ****
  	}
  
        return \"mov %1,%0\";
!     case 8:
!     case 9:
        return \"movbu %1,%0\";
      default:
        abort ();
      }
  }"
!   [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
  
  ;; movhi
  
--- 122,135 ----
  	}
  
        return \"mov %1,%0\";
!     case 3:
!     case 4:
        return \"movbu %1,%0\";
      default:
        abort ();
      }
  }"
!   [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
  
  ;; movhi
  

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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