This is the mail archive of the gcc@gcc.gnu.org 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]
Other format: [Raw text]

Re: GCC floating point usage


On Monday, October 14, 2002, at 09:59  AM, Zack Weinberg wrote:
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 the issue back up.
Apple's group has users who want this also. From one viewpoint the real
problem is that the compiler's idea of "efficient to use them" is not
always accurate; but doing better may require information not available
to the compiler, as in Stefan Bylund's case. Overall I think a patch
of this sort is a good idea.

(We also have users who carefully write double stores to zero out an array,
and are annoyed when the compiler changes them into two int stores.
[Actually a mix may be better than either.] I wouldn't mind having Zach's
switch, or another switch, disable this behavior also.)


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