compiler optimization for CPU familes

Fortunately or unfortunately, we have various CPU families used in the build, test, and production families. They include UltraSparc II's, UltraSparc III's, and UltraSparc IV+'s.

In this scenario, can I use -fast option for optimization of my sources? If not, which would be the best options that I can go for it?

I appreciate your efforts in advance...

-Saravanan Kannan

[399 byte] By [Sara_Kan] at [2007-11-26 10:35:45]
# 1
It looks like I can use a combination of -xtarget=ultra3 with -xarch=v8plusa . Any better suggestions are welcome...
Sara_Kan at 2007-7-7 2:46:39 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

The -fast option generates code tor the exact processor that runs the compilation. The resulting code might not run on an earlier processor, and in might not run as well on other processors compared to just using the generat -xO4 flag.

The combination

-xO4 -xarch=v8plusa -xtarget=ultra3

will generate well-optimized code that runs best on Ultra III, but will also run on Ultra II and IV.

It would be a good idea to build with and without the -xtarget option, and compare performance on all systems. You cannot predict in advance whether overall performance across systems will be better with or without the option.

You should also experiment with -xO5. It often gives better performance, but leads to larger code size. Sometimes the larger code size results in more paging at run time, destroying the benefits of micro-optimization.

See also this forum article:

http://forum.sun.com/jive/thread.jspa?threadID=108492

clamage45 at 2007-7-7 2:46:39 > top of Java-index,Development Tools,Solaris and Linux Development Tools...