This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC floating point usage
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>, Mike Stump <mrs at apple dot com>
- Cc: Geoff Keating <geoffk at geoffk dot org>, "steby at enea dot se" <steby at enea dot se>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 16 Oct 2002 13:33:36 -0700
- Subject: Re: GCC floating point usage
I think that the proper solution to this to have a mode in which
the compiler does not *prefer* to use FP registers for integral
data. But the assembler would set a bit if any FP registers are
used, which would then be collected by the linker to indicate
whether or not the process as a whole uses FP registers.
This is a dynamic property; not a static one. Linking in printf is
fine, if you never call it with "%g", and you know that it doesn't
use floating-point registers otherwise. You don't want two printfs;
memory is tight, and you want to be able to share your one printf
between tasks.
You just don't want the compiler to generate FP register moves for
integer programs.
Anything less is asking for trouble.
Yes, programmers have to be very careful not to accidentally let FP
slip into no-FP tasks. But, hey, we're in C on embedded systems; we
have to be careful about lots of things. This is just one more...
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com