Tuesday March 07, 2006 GCC for SPARC Systems is live!
Finally we got "GCC for SPARC Systems" out:
http://cooltools.sunsource.net/gcc/
To get the most out of SPARC chips the compiler optimizations are important. Apps on x86 chips usually don't gain much if recompiled for the specific chip. The difference between -mcpu=i386 and -mcpu=i686 gcc switch is relatively small. On SPARC the correct chip switch is more important. US2 comiled apps will suffer on early US3.
The plain GCC is using SPARC V7 ABI as a default. That means no integer mul/div instructions and schedulling for pretty old chip. Not every GCC user knows about -mcpu flag and its effect. Some users use -mcpu=v9 for all their needs, because other -mcpu switches don't produce a desirable speedup. Some users add only -mv8plus flag, see no difference in run-time and get upset. A few internal details of SPARC chips are not public and it's tough for GCC to do the perfect tuning. Read after write penalties are not modelled correctly in GCC scheduler yet. The cost of prefetch instruction and prefetch implication on the different SPARC chips didn't made into GCC backend. The users of gcc 4.0.x have to cope with early US3 tuning. The future gcc 4.2 release is going to have some support for Niagara. So the Niagara users have an option to wait till stable gcc 4.2 is released, or try its development snapshot, or go with gcc4ss+scg4ss which already has Niagara specific tuning.
With GCC for SPARC Systems (gcc4ss) the code generation, tuning, insn scheduling,etc is done by Sun Code Generator for SPARC Systems (scg4ss) that knows everything about underlying architecture. Going from GCC's V7 to tuned code normally buys a nice speedup for integer code and a lot more for floating point.
The default arch selection for gcc4ss is v8plus (since it's tough now days to find pre-v8plus chip) and tuning is done for 'blended' model, which is trying to produce close to optimum tuning on most of the modern SPARC chips. So just recompiling with gcc4ss with the same old gcc flags can give a significant boost in performance.
Alexey.
Posted by alexey ( Mar 07 2006, 09:21:54 AM PST ) Permalink Comments [5]This site is a personal blog and is to be used for informational purposes only. The views expressed on this blog are those of the author only, and should not be attributed to any past or present employers.
Posted by p on March 10, 2006 at 10:54 PM PST #
Posted by Alexey on March 11, 2006 at 01:01 AM PST #
Posted by p on March 11, 2006 at 10:33 AM PST #
Posted by Alexey on March 13, 2006 at 12:33 AM PST #
Posted by Alexey on March 13, 2006 at 12:36 AM PST #