[patch] Re: reload vs adds with clobbers

DJ Delorie dj@redhat.com
Thu Jun 5 19:40:00 GMT 2003


This is the patch I ended up testing.  No regressions.  The "!N"
constraint catches the case of adding zero to a register, since it
normally covers -3..0 yet the P constraint already matches -4..-1.
Ok?

Index: stormy16.md
===================================================================
RCS file: /usr/dj/gnu/gcc/repository/gcc/gcc/config/stormy16/stormy16.md,v
retrieving revision 1.13
diff -p -2 -r1.13 stormy16.md
*** stormy16.md	24 May 2003 16:54:04 -0000	1.13
--- stormy16.md	4 Jun 2003 20:47:19 -0000
***************
*** 1,4 ****
  ;; XSTORMY16 Machine description template
! ;; Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
  ;; Contributed by Red Hat, Inc.
  
--- 1,4 ----
  ;; XSTORMY16 Machine description template
! ;; Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
  ;; Contributed by Red Hat, Inc.
  
***************
*** 278,289 ****
  ; will fail in some cases.
  (define_insn "addhi3"
!   [(set (match_operand:HI 0 "register_operand" "=r,r,T,T,r,r,r")
! 	(plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0,0,0")
! 		 (match_operand:HI 2 "xs_hi_nonmemory_operand" "O,P,L,M,Ir,N,i")))
!    (clobber (match_scratch:BI 3 "=X,X,&y,&y,&y,&y,&y"))]
    ""
    "@
     inc %0,%o2
     dec %0,%O2
     add Rx,%2
     sub Rx,#%n2
--- 278,290 ----
  ; will fail in some cases.
  (define_insn "addhi3"
!   [(set (match_operand:HI 0 "register_operand" "=r,r,r,T,T,r,r,r")
! 	(plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0,0,0,0")
! 		 (match_operand:HI 2 "xs_hi_nonmemory_operand" "O,P,!N,L,M,Ir,N,i")))
!    (clobber (match_scratch:BI 3 "=X,X,X,&y,&y,&y,&y,&y"))]
    ""
    "@
     inc %0,%o2
     dec %0,%O2
+    ;
     add Rx,%2
     sub Rx,#%n2
***************
*** 291,295 ****
     sub %0,#%n2
     add %0,%2"
!   [(set_attr "length" "2,2,2,2,2,2,4")])
  
  ; Reload can generate addition operations.  The SECONDARY_RELOAD_CLASS
--- 292,296 ----
     sub %0,#%n2
     add %0,%2"
!   [(set_attr "length" "2,2,2,2,2,2,2,4")])
  
  ; Reload can generate addition operations.  The SECONDARY_RELOAD_CLASS



More information about the Gcc-patches mailing list