Go Back   AnandTech Forums > Software > Software for Windows

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals
· Free Stuff
· Contests and Sweepstakes
· Black Friday 2013
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 01-26-2006, 12:24 PM   #1
Armitage
Banned
 
Join Date: Feb 2001
Posts: 8,086
Default -ffast-math compiler option

Anybody use it? I just turned it on on a whim and picked up about 7% (on repeated runs).

Among other things, this turns on -funsafe-math-optimizations
From the man page:

Quote:
-funsafe-math-optimizations
Allow optimizations for floating-point arithmetic that (a) assume that arguments and results are valid and (b) may violate IEEE or ANSI standards. When used at link-time, it may include libraries or startup files that change the default FPU control word or other similar optimizations.

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 functions.
So the engineer in me is saying Bad Idea, and I'll probably stick with that. But a quick look at the results doesn't show any significant difference and 7% is 7%, right? So I'm wondering if anybody has any better insight into what this option means.

FWIW, this is GCC 3.3.5, Linux on dual opterons, 64 bit
Armitage is offline   Reply With Quote
Old 01-26-2006, 12:35 PM   #2
Armitage
Banned
 
Join Date: Feb 2001
Posts: 8,086
Default -ffast-math compiler option

Here's an example of a difference in the results. The value is a range between two objects in Km

32.6364004527575 With -ffast-math
32.6364004529829 Without --fast-math

2.25e-10 Km = 225 nanometers
Not to bad considering the errors in the models I'm using are at least on the order of meters to 10s of meters.
Armitage is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:23 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.