This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: sh-elf newlib broken
- To: John Wehle <john at feith dot com>
- Subject: Re: sh-elf newlib broken
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 20 Mar 2001 07:57:33 -0300
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <200103200822.DAA14790@jwlab.FEITH.COM>
On Mar 20, 2001, John Wehle <john@feith.com> wrote:
> Compiling libF77/c_log.c with -O2 -m4-single produces:
> sts fpul,@-r8 ! 120 movsf_ie/15 [length = 2]
Oops. This is wrong. The opcode should have been sts.l. Apparently,
it ended up not being used as often as I had thought it might. In the
round of test I'd run before checking my 2001-02-07's patch, there
were no regressions, so it wasn't used at all. But I may have failed
to build f77 in my test :-(
Fixed as follows. Thanks for the report! I've tested this on
alpha-unknown-linux-gnu and installed in mainline and release branch.
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.md (movsf_ie): Fix output patterns for fpul load
and store.
(movsi_ie): Introduce fpul store.
Index: gcc/config/sh/sh.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.md,v
retrieving revision 1.80
diff -u -p -c -r1.80 sh.md
*** gcc/config/sh/sh.md 2001/03/11 02:48:16 1.80
--- gcc/config/sh/sh.md 2001/03/20 10:47:34
***************
*** 2438,2445 ****
;; ??? This allows moves from macl to fpul to be recognized, but these moves
;; will require a reload.
(define_insn "movsi_ie"
! [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,t,r,r,r,r,m,<,<,x,l,x,l,y,r,y,r,y")
! (match_operand:SI 1 "general_movsrc_operand" "Q,rI,r,mr,x,l,t,r,x,l,r,r,>,>,>,i,r,y,y"))]
"TARGET_SH3E
&& (register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
--- 2438,2445 ----
;; ??? This allows moves from macl to fpul to be recognized, but these moves
;; will require a reload.
(define_insn "movsi_ie"
! [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,t,r,r,r,r,m,<,<,x,l,x,l,y,<,r,y,r,y")
! (match_operand:SI 1 "general_movsrc_operand" "Q,rI,r,mr,x,l,t,r,x,l,r,r,>,>,>,y,i,r,y,y"))]
"TARGET_SH3E
&& (register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
***************
*** 2459,2470 ****
lds.l %1,%0
lds.l %1,%0
lds.l %1,%0
fake %1,%0
lds %1,%0
sts %1,%0
! move optimized away"
! [(set_attr "type" "pcload_si,move,*,load_si,move,prget,move,store,store,pstore,move,prset,load,pload,load,pcload_si,gp_fpul,gp_fpul,nil")
! (set_attr "length" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])
(define_insn "movsi_i_lowpart"
[(set (strict_low_part (match_operand:SI 0 "general_movdst_operand" "+r,r,r,r,r,r,m,r"))
--- 2459,2471 ----
lds.l %1,%0
lds.l %1,%0
lds.l %1,%0
+ sts.l %1,%0
fake %1,%0
lds %1,%0
sts %1,%0
! move optimized away"
! [(set_attr "type" "pcload_si,move,*,load_si,move,prget,move,store,store,pstore,move,prset,load,pload,load,store,pcload_si,gp_fpul,gp_fpul,nil")
! (set_attr "length" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])
(define_insn "movsi_i_lowpart"
[(set (strict_low_part (match_operand:SI 0 "general_movdst_operand" "+r,r,r,r,r,r,m,r"))
***************
*** 3084,3094 ****
;; when the destination changes mode.
(define_insn "movsf_ie"
[(set (match_operand:SF 0 "general_movdst_operand"
! "=f,r,f,f,fy,f,m,r,r,m,f,y,y,rf,r<,y,y")
(match_operand:SF 1 "general_movsrc_operand"
! "f,r,G,H,FQ,mf,f,FQ,mr,r,y,f,>,fr,y,r>,y"))
! (use (match_operand:PSI 2 "fpscr_operand" "c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c"))
! (clobber (match_scratch:SI 3 "=X,X,X,X,&z,X,X,X,X,X,X,X,X,y,X,X,X"))]
"TARGET_SH3E
&& (arith_reg_operand (operands[0], SFmode)
--- 3085,3095 ----
;; when the destination changes mode.
(define_insn "movsf_ie"
[(set (match_operand:SF 0 "general_movdst_operand"
! "=f,r,f,f,fy,f,m,r,r,m,f,y,y,rf,r,y,<,y,y")
(match_operand:SF 1 "general_movsrc_operand"
! "f,r,G,H,FQ,mf,f,FQ,mr,r,y,f,>,fr,y,r,y,>,y"))
! (use (match_operand:PSI 2 "fpscr_operand" "c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c"))
! (clobber (match_scratch:SI 3 "=X,X,X,X,&z,X,X,X,X,X,X,X,X,y,X,X,X,X,X"))]
"TARGET_SH3E
&& (arith_reg_operand (operands[0], SFmode)
***************
*** 3117,3125 ****
#
sts %1,%0
lds %1,%0
! move optimized away"
! [(set_attr "type" "fmove,move,fmove,fmove,pcload,load,store,pcload,load,store,fmove,fmove,load,*,gp_fpul,gp_fpul,nil")
! (set_attr "length" "*,*,*,*,4,*,*,*,*,*,2,2,2,4,2,2,0")
(set (attr "fp_mode") (if_then_else (eq_attr "fmovd" "yes")
(const_string "single")
(const_string "none")))])
--- 3118,3128 ----
#
sts %1,%0
lds %1,%0
+ sts.l %1,%0
+ lds.l %1,%0
! move optimized away"
! [(set_attr "type" "fmove,move,fmove,fmove,pcload,load,store,pcload,load,store,fmove,fmove,load,*,gp_fpul,gp_fpul,store,load,nil")
! (set_attr "length" "*,*,*,*,4,*,*,*,*,*,2,2,2,4,2,2,2,2,0")
(set (attr "fp_mode") (if_then_else (eq_attr "fmovd" "yes")
(const_string "single")
(const_string "none")))])
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me