This is the mail archive of the
mailing list for the GCC project.
Re: GCC floating point usage
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Zack Weinberg <zack at codesourcery dot com>, David Edelsohn <dje at watson dot ibm dot com>
- Cc: Stefan Bylund <steby at enea dot se>, gcc at gcc dot gnu dot org
- Date: Mon, 14 Oct 2002 19:37:40 -0700
- Subject: Re: GCC floating point usage
--On Monday, October 14, 2002 09:59:00 AM -0700 Zack Weinberg
On Mon, Oct 14, 2002 at 12:37:14PM -0400, David Edelsohn wrote:
>>>>> Stefan Bylund writes:
Stefan> Is it possible to somehow instruct GCC to only generate
Stefan> floating point instructions for C/C++ float/double
Stefan> operations and not for internal non-floating point
Stefan> optimizations etc?
If you do not want to use the FPU, then invoke the compiler with
the -msoft-float PowerPC option. If the FPRs are present and it is
efficient to use them, the compiler will use them.
Come now, what he wants is not unreasonable. "If floating point
operations appeared in the source code, generate hardware floating
point instructions; otherwise, generate only integer-unit
instructions." I (that is, CodeSourcery) have a customer that needs
precisely this; in fact I posted a patch to implement it for PPC last
fall. Now seems like a reasonable time to bring this issue back up.
I agree, on all points:
(1) Clearly, many people have a real need for this fuctionality.
(2) You are correct; if the user has told the compiler not to use
hardware FP unless floating point operations appear in the code,
then the MD should not pretend it knows how to do moves that it
can only do with FP registers.
With the caveat that you perserve the current default behavior, the
patch is OK for the b-i-b, assuming that you do not hear objections
from the RS6000 maintainers within a couple of days. If they do
object, we will figure out what to do.
Mark Mitchell firstname.lastname@example.org
CodeSourcery, LLC http://www.codesourcery.com