By Darryl Gove on Dec 08, 2006
Roland Mainz posted a comment that deserves a good answer. The question can be summarised as what are the caveats when using -fast?
The long answer is contained in this article on compiler options. The short answer is as follows:
- -fast enables floating point simplification, and also allows the hardware to flush sub-normal (ie very small) numbers to zero. This allows the compiler to perform floating point operations in a different order, or to replace (expensive) divide operations with (cheaper) multiplications. If your application does floating point computation, then it's probably worth looking at this paper which goes into detail on floating point computation.
- The second caveat is that it causes the compiler to optimise for the hardware doing the compile. This shouldn't usually cause a problem, but it is worth considering what hardware would be the appropriate target, and explicitly setting that target after the -fast flag (if only to avoid the annoying warning message that the compiler will otherwise emit).
For the particulars of blast , it's an integer code (which is why it is such a good fit for UltraSPARC-T1). It apparently does have a small amount of floating point content, for calculating statistics, at the end of the run. Floating point simplification will not impact the integer part of the code, so the answer will remain the same. Since there's no significant floating point code, the flag is unlikely to make a difference, so there's little odds whether it is enabled or not.