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


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


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