Re: Somewhat OT: gcc, x86, -ffast-math, and Linux
From: Jamie Lokier (jamie_at_shareable.org)
Date: 03/27/04
- Previous message: Frank A. Uepping: "Re: struct device::release issue"
- In reply to: Daniel Forrest: "Somewhat OT: gcc, x86, -ffast-math, and Linux"
- Next in thread: Jakub Jelinek: "Re: Somewhat OT: gcc, x86, -ffast-math, and Linux"
- Reply: Jakub Jelinek: "Re: Somewhat OT: gcc, x86, -ffast-math, and Linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Mar 2004 14:24:59 +0000 To: Daniel Forrest <forrest@lmcg.wisc.edu>
Daniel Forrest wrote:
> What is the -ffast-math option doing?
It enables some optimisations and mathematical transformations which
do not satisfy the properties of IEEE floating point arithmetic.
(Not that GCC's output satisfies those properties without -ffast-math
on x86, but this flag enables much looser semantics).
> How are the excess bits of precision dealt with during context
> switches?
They are preserved - they are part of the floating point context.
If there is any failure to preserve all of that context, it's a kernel bug.
> Shouldn't the same binary with the same inputs produce the same
> output on identical hardware?
Is the hardware *identical*, or are they different x86 CPUs?
Different CPUs give different results for the trigonometric functions.
GCC's manual claims that fsin, fcos and fsqrt instructions are only
used if the -funsafe-math-optimizations flag is also used, if the GCC
version is >= 2.6.1. However you may find that Glibc's <math.h> ends
up using those instructions when -ffast-math is used alone.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Frank A. Uepping: "Re: struct device::release issue"
- In reply to: Daniel Forrest: "Somewhat OT: gcc, x86, -ffast-math, and Linux"
- Next in thread: Jakub Jelinek: "Re: Somewhat OT: gcc, x86, -ffast-math, and Linux"
- Reply: Jakub Jelinek: "Re: Somewhat OT: gcc, x86, -ffast-math, and Linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|