[patch] h8300.md: Correct the length of movsi.

Kazu Hirata kazu@hxi.com
Wed Feb 13 06:48:00 GMT 2002


Hi,

Attached is a patch to correct the length of movsi.

Tested on h8300 port.  Committed.

Kazu Hirata

2002-02-13  Kazu Hirata  <kazu@hxi.com>

	* config/h8300/h8300.c (h8300_adjust_insn_length): Correct the
	length computation of movsi.
	* config/h8300/h8300.md (movsi_h8300hs): Correct the length.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.114
diff -c -r1.114 h8300.c
*** h8300.c	2002/02/12 15:31:54	1.114
--- h8300.c	2002/02/13 12:43:07
***************
*** 3224,3233 ****
  	{
  	  if (val == (val & 0xff)
  	      || val == (val & 0xff00))
! 	    return -6;
  
! 	  if (val == -4 || val == -2 || val == -1)
! 	    return -6;
  	}
      }
  
--- 3224,3244 ----
  	{
  	  if (val == (val & 0xff)
  	      || val == (val & 0xff00))
! 	    return 4 - 6;
  
! 	  switch (val & 0xffffffff)
! 	    {
! 	    case 0xffffffff:
! 	    case 0xfffffffe:
! 	    case 0xfffffffc:
! 	    case 0x0000ffff:
! 	    case 0x0000fffe:
! 	    case 0xffff0000:
! 	    case 0xfffe0000:
! 	    case 0x00010000:
! 	    case 0x00020000:
! 	      return 4 - 6;
! 	    }
  	}
      }
  
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.74
diff -c -r1.74 h8300.md
*** h8300.md	2002/02/13 12:42:33	1.74
--- h8300.md	2002/02/13 12:43:07
***************
*** 535,541 ****
      }
     return \"mov.l	%S1,%S0\";
  }"
!   [(set_attr "length" "2,2,10,10,10,4,4,2,6,4")
     (set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])
  
  (define_insn "movsf_h8300h"
--- 535,541 ----
      }
     return \"mov.l	%S1,%S0\";
  }"
!   [(set_attr "length" "2,2,6,10,10,4,4,2,6,4")
     (set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])
  
  (define_insn "movsf_h8300h"



More information about the Gcc-patches mailing list