X
  • Work
    January 24, 2006

Compiling for UltraSPARC-T1

Guest Author

I recently updated this article on selecting compiler options. The changes were subtle, but necessary to include UltraSPARC-T1 into the range of processors covered.

The compiler, by default, targets a 'generic' processor - this means it produces code that works well across all the UltraSPARC family of processors. Of course, this means that the code does have some compromises, and these compromises can mean accepting slightly lower performance on one processor in favour of better performance across all processors.

An example might help here. An UltraSPARC-III processor can get large benefits from aggressively adding prefetch instructions to the code generated by the compiler. On the other hand an UltraSPARC-T1 is designed to hide memory latency by using multiple threads, consequently prefetch is not nearly as important for this processor. There's a balance to be struck when producing code that runs well on both the processors, and that's where the -xtarget=generic flag comes in.

The consequence for the developer is that when producing a single binary that needs to give good performance across a wide a range of processors as possible, then the best compiler option to use is -xtarget=generic.

On the other hand when the target platform is known, it can be better to explicitly use this with -xtarget=ultra3 or -xtarget=ultraT1.

For more a more detailed look, Denis Sheahan has a whitepaper on tuning for UltraSPARC-T1.


Tag:

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.