This is the mail archive of the
mailing list for the GCC project.
Re: Fix for gcc.c-torture/special/920520-1.c on powerpc
- To: Geoff Keating <geoffk at ozemail dot com dot au>
- Subject: Re: Fix for gcc.c-torture/special/920520-1.c on powerpc
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 04 Sep 1998 03:07:34 -0600
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199808250304.NAA13566@geoffk.wattle.id.au>you write:
> The problem is that assign_stack_temp is really not a good idea to
> call during reload for a constant; it's also silly, because a SF
> operand can easily be loaded directly into a GPR.
> This probably isn't important enough to put in egcs 1.1 at this late
> Geoffrey Keating <email@example.com>
> ===File ~/patches/egcs-4.diff===============================
> Tue Aug 25 07:32:27 1998 Geoff Keating <firstname.lastname@example.org>
> * config/rs6000/rs6000.md (movsf): Moves of const_double:SF to
> GPRs don't, and shouldn't, go through memory.
I'm going to recommend against hacking up the movsf expander for now.
Some of this stuff is in the process of being cleaned up. Once the
rs6000 backend isn't performing secondary memory reloads itself this
problem may just go away with a trivial amount of work.
Another possibility would be to see if tweaking PREFERRED_RELOAD_CLASS
would avoid the problem to start with by having reload put the constant
into memory for us.
A final possibility is to create a separate pattern to deal with this
stuff. That's what I did on the PA when I couldn't get
PREFERRED_RELOAD_CLASS to do the right thing a few years back:
;; This pattern forces (set (reg:SF ...) (const_double ...))
;; to be reloaded by putting the constant into memory when
;; reg is a floating point register.
;; For integer registers we use ldil;ldo to set the appropriate
;; This must come before the movsf pattern, and it must be present
;; to handle obscure reloading cases.
[(set (match_operand:SF 0 "register_operand" "=?r,f")
(match_operand:SF 1 "" "?F,m"))]
"GET_CODE (operands) == CONST_DOUBLE
&& operands != CONST0_RTX (SFmode)
&& ! TARGET_SOFT_FLOAT"
"* return (which_alternative == 0 ? singlemove_string (operands)
: \" fldw%F1 %1,%0\");"
[(set_attr "type" "move,fpload")
(set_attr "length" "8,4")])