Compiling (was RE: [SPARCbook] re: linux on GX)

Matt Evans bmajik at vai.loathe.com
Thu Nov 4 02:48:29 CST 1999


whofmann at yahoo.com wrote:
> I'll agree with that.  At work, my workstation is an Ultra10/Creator3D.
> What I've found to be very nice is using the following value for CFLAGS,
> "-O2 -msupersparc" when compiling software on my Ultra running Solaris 2.6.
> I can then just copy the binaries in /usr/local over to my sparcbook (also
> running solaris 2.6).  Needless to say, the ultra compiles MUCH more quickly
> than my sparcbook.  The quesiton is, since they have two different
> processors, WHY are they binary compatible?  What compiler flags SHOULD I be
> using on the ultra?  On the sparcbook?  Is there a problem with what I've
> been doing?  Any input on this would be greatly appreciated.

the Ultra is SPARC v9 architecture, and is a superset of SPARC v8 (the
supersparc is included in v8).  

in other words, when you compile with -O2 -msupersparc, you're building
a binary optimized for supersparc chips (which btw, your tadpole isn't,
it's
a microsparc II)  Something like an SS10 or SS20 would be a supersparc
(unless it were using ROSS modules, in which case it would be a
hypersparc).

at any rate, super, micro, microII, and cypress are all different
implementations of the sparc v8 architecture.  -msupersparc will just tell
the compiler to do scheduling optimizations based on the supersparcs
internal architecture (multiple issue, cache size assumptions).  THis may
be less than optimum on your tadpole.  It is certainly less than optimum on
the Ultra, but not that bad.  

For maximum performance out of the ultra you'd probably want to specify 
sparc v9 instructions.  currently, gcc can't do this to the best of my
knowledge.  the best you can do with gcc is probably something like

gcc -O3 -mv8

for your tadpole

if you have Sun's cc/CC, you can do much better IMO.  things like

cc -O5 -xchip=super exist.  you can even specify the L1/L2 caches sizes of
the target processor.  Sun's cc is very comprehensive. if you have it
available
somewhere, to get the best performance out of your tadpole, you might try

cc -xO4 -xtarget=ss5

Note that this is as of SC 4.2.  5.0 probably has more options and
features,
and better support for ultra machines.

-- 
Matt Evans     email: mevans at cse.unl.edu      web: www.loathe.com/~bmajik
"And God saw that the wickedness of man was great in the earth, and that 
every imagination of the thoughts of his heart was only evil continually."
	- Genesis 6:5






More information about the SPARCBook mailing list