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 Wed, Oct 16, 2002 at 02:54:29PM -0700, Mark Mitchell wrote:
> Since you think the semantics are unclear, I'll make an effort to state
> them again:
> 
>  If the user does not explicitly use floating point at the source
>  level, the compiler will not generate reads to or writes from the
>  floating point registers that can ever be executed by the program,
>  unless that program calls "setjmp" or makes use of exception-handling.

I would prefer to phrase it thus:

  The compiler will not generate floating point instructions that can
  ever be executed by the program, unless either

  (a) the source code of the program makes use of floating point, or

  (b) the source code of the program contains constructs which -
  although not explicitly using floating point - cannot be implemented
  in an ABI-compatible manner without causing the compiled program to
  execute floating point instructions.

  Examples of such constructs are: exception handling, setjmp,
  longjmp, and variadic functions.  This list is not necessarily
  exhaustive, nor do all of these constructs necessarily require
  floating point.

[On the PowerPC, the SVR4 ABI allows variadic functions to be used
without executing floating point instructions, as long as no actual
argument has a floating point type.  This is not true of other ABIs.
For instance, some ABIs for the SH with hardware floating point do
require any variadic function to execute floating point instructions
in its prologue.]

[As that comment might suggest, a version of this feature that's
architecture independent would be preferred by the people who
originally asked me to implement it.  I don't presently see any way to
do it in an architecture-independent fashion, but I'm open to
suggestions.]

Your description of what "the source code of the program makes use of
floating point" means for C, works for me.

zw


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