This is the mail archive of the 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: Fix for gcc.c-torture/special/920520-1.c on powerpc

  In message <>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
  > stage.
  > -- 
  > Geoffrey Keating <>
  > ===File ~/patches/egcs-4.diff===============================
  > Tue Aug 25 07:32:27 1998  Geoff Keating  <>
  > 	* config/rs6000/ (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
;; value.
;; This must come before the movsf pattern, and it must be present
;; to handle obscure reloading cases.
(define_insn ""
  [(set (match_operand:SF 0 "register_operand" "=?r,f")
        (match_operand:SF 1 "" "?F,m"))]
  "GET_CODE (operands[1]) == CONST_DOUBLE
   && operands[1] != CONST0_RTX (SFmode)
  "* return (which_alternative == 0 ? singlemove_string (operands)
                                    : \" fldw%F1 %1,%0\");"
  [(set_attr "type" "move,fpload")
   (set_attr "length" "8,4")])

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