my crude benchmark results

Andrew Cowie andrew@operationaldynamics.com
Wed Jul 14 02:32:00 GMT 2004


I was of the understanding that -ffast-math in the normal C compilation
world was generally a bad idea unless one knows what one was doing:

From gcc's man page:
>        -ffast-math
>            Sets -fno-math-errno, -funsafe-math-optimizations, -fno-trap-
>            ping-math, -ffinite-math-only and -fno-signaling-nans.
> 
>            This option causes the preprocessor macro "__FAST_MATH__" to be
>            defined.
> 
>            This option should never be turned on by any -O option since it can
>            result in incorrect output for programs which depend on an exact
>            implementation of IEEE or ISO rules/specifications for math func-
>            tions.

like floating point operations needing to come out with correct
answers ;), ie, it's ok one is doing a problem that is dealing with
positive integers or some carefully designed number theory problem, etc.

But,

On Tue, 2004-07-13 at 13:45 -0400, Bryce McKinlay wrote:
> But, theres another option you should know about. With --fast-math 
> (which causes the Math.* calls to be inlined directly into FPU 
> instructions), the performance improves dramatically:

From the sounds of it, --fast-math as an option to gcj is something else
entirely. If so, 

a) that's very cool
b) that's very confusing

AfC
Sydney

-- 
Andrew Frederick Cowie

OPERATIONAL DYNAMICS
Operations Consultants and Infrastructure Engineers

http://www.operationaldynamics.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040714/32b7af67/attachment.sig>


More information about the Java mailing list