This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: -mfpmath=sse -fpic vs double constants
- From: Dale Johannesen <dalej at apple dot com>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: Dale Johannesen <dalej at apple dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 Jul 2005 10:14:20 -0700
- Subject: Re: RFA: -mfpmath=sse -fpic vs double constants
- References: <fda4ff71b36df5e262502282c5c8ea55@apple.com> <42CE9DC9.1030708@lu.unisi.ch> <42CEA12B.6030001@lu.unisi.ch> <42CEAAA3.5010703@lu.unisi.ch>
On Jul 8, 2005, at 9:32 AM, Paolo Bonzini wrote:
Like this; untested, but pretty obvious. Ok for mainline?
David Edelsohn disapproved this on IRC because PPC benefits from this
(also performance-wise).
I know, that's why I didn't try this.
In principal I also would prefer a solution in or near
compress_float_constant; it's cleaner
to do things right in the first place than rely on some later pass to
clean them up. But we
need to do a target-dependent cost comparison, as David says. I think
we might need to
look at a little more context than just the constant, also, as some FP
constants are valid as
immediate operands and others aren't in some cases (e.g. FLDPI on x86).
Nobody's objected to the general approach, so I'll play around with
it....
It is possible to change compress_float_constant to do the change only
if {cost_of_load_single}+{cost_of_extend} <= {cost_of_load_double}.
Unfortunately a change to compress_float_constant needs auditing on
all targets that explicitly test the cost of FLOAT_EXTEND. These are:
- alpha
- i386
- mips
- rs6000, whose cost can be lowered to 0 for DFmode
- sparc
- vax, whose cost have to be checked anyway according to a comment.
Paolo