good (working) CFLAGS for SPARC64

Steven Hillis evultrole at
Fri Feb 23 22:10:01 UTC 2007

So, changing the __sparc_v9__ to __sparc64___ in 5 files (something for asm
in bind9 and four files in contrib/gcc/config/sparc, only two of which are
actually used) makes CPU flags work properly.

I do not yet know whether it disables their effects or not (i.e. does
setting it to __sparc_v9__ have some effect on the code output, or is it an
arbitrary label with optimizations controlled by the -Av9a thing?)

I have compiled the tree successfully using mcpu=ultrasparc after very few
changes, and am trying to work up a proper benchmark to see if it actually
did anything at all. The other side (if this just disabled their effects)
consists of replacing all the ifdef __sparc64__ lines with if
defined(__sparc64__) || defined(__sparc_v9__) in about 400 places, none of
which are just standard lines I can swap out using sed... so I'm hoping I
can fix it with the 5 changes rather than the other way around... I'll up a
source diff after I get it worked out properly.

Incidentally, bzip2 works at exactly the same speed with the mcpu flag set
for compile and with a standard compile... that means one of three things:
code is already set to ultrasparc || I disabled the mcpu flag effects ||
ultrasparc has too many cache hits for optimization to matter in compression

I don't really know enough about the internals of the GCC optimization
settings and how flags affect it to be certain until I get some sort of real
number on this (currently I'm trying to just use average build time for
buildworld and comparing mcpu'd gcc with non) so if anyone can shed light on
what that does (just a quick sentence or two) that would probably help.

More information about the freebsd-sparc64 mailing list