Using -fast

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.

Comments:

Post a Comment:
Comments are closed for this entry.
About

Darryl Gove is a senior engineer in the Solaris Studio team, working on optimising applications and benchmarks for current and future processors. He is also the author of the books:
Multicore Application Programming
Solaris Application Programming
The Developer's Edge

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
5
6
8
9
10
12
13
14
15
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
The Developer's Edge
Solaris Application Programming
Publications
Webcasts
Presentations
OpenSPARC Book
Multicore Application Programming
Docs