Friday Jun 08, 2007
|
We are the Solaris Developer Information Products Team:
Richard Friedman, David Lindt, Kami Shahi, Jyothi Srinath, Paul Echeverri, Ann Rice, Alta Elstad, Susan Morgan, Frank Jennings
Today's Page Hits: 27
Friday Jun 08, 2007
|
Here's what's new and changed in the Sun Studio 12 compilers:
You no longer need use the -xarch option to specify a 32-bit or 64-bit address model (LP64 versus ILP32). Two new options make it easier:
-m32 specifies the ILP32 model: 32-bit ints, longs, and pointer types.
-m64 specifies the LP64 model: 32-bit ints, 64-bit longs and pointers types. (Note that -m64 is the default on Linux platforms.)
Use -m64 in place of -xarch=generic64
Use -m64 -xarch=native in place of -xarch=native64
If you are using -xarch=v9 or -xarch=amd64 to specify a 64-bit address model, use just -m64 instead. No -xarch value is required.
Use -xarch=sparc in place -xarch=v8plus
Use -xarch=sparcvis in place of -xarch=v8plusa
Use -xarch=sparcvis2 in place of -xarch=v8plusb
Use -xarch=sparc -m64 in place of -xarch=v9
Use -xarch=sparcvis -m64 in place of -xarch=v9a
Use -xarch=sparcvis2 -m64 in place of -xarch=v9b
Use -xarch=sse2 -m64 in place of -xarch=amd64.
Use -xarch=sse2a -m64 in place of -xarch=amd64a.
The compilers do not allow the combination of a deprecated -xarch value and the new -m32, -m64 options on the command line. For example, specifying -xarch=v9 -m32 is now a fatal error. Specifying -xarch=sparc -xarch=v9 is also a fatal error.
Some older -xarch values do
not have 64-bit counterparts. You cannot combine the following -xarch
options with -m64 on the
command line:
For SPARC platforms: -xarch=v7, -xarch=v8, -xarch=v8a
For x86 platforms: -xarch=386, -xarch=pentium_pro, -xarch=pentium_proa, -xarch=sse, -xarch=ssea
If you specify a 32-bit -xarch value followed by -m64, the compiler does not issue a warning. For example -m64 -fast or -fast -m64 are allowed. However, if you specify a 64-bit -xarch value followed by -m32, the compiler issues a warning that -m32 overrides the -xarch value. This situation does not occur using macro options, only when an -xarch option has been explicitly specified.
The following are new x86 flags for the -xarch option:
-xarch=sse3 specifies that the compiler should generate instructions based on both the SSE3 and SSE2 architectures.
-xarch=sse3a specifies that the compiler should generate instructions based on the SSE3, SSE2 and AMD extended architectures as well as the 3DNow extensions.
The -fast option on x86 now includes -xregs=frameptr, which means that the compiler can use the frameptr register (%ebp on IA32, %rbp on AMD64) as a general purpose register to generate code for all the compilation units. Consequently frame pointers will not be generated in each function or routine.
However, if you want to override this new behavior, specify -xregs=no%frameptr after -fast in the compilation command and the frameptr register will not be used as a general purpose register. The following example demonstrates how to override the -fast default for -xregs:
cc -fast -xregs=no%frameptr foo.c
This release of the Sun Studio compilers includes support for the SPARC64 VI and UltraSPARC T2 processors. Use the following new options to specify these processors:
-xtarget=sparc64vi
-xtarget=ultraT2
You can also specify the following -xchip options to generate code for these processors without setting the -xarch value automatically as happens when you use -xtarget:
-xchip=sparc64vi
-xchip=ultraT2
You can also specify the -xarch values explicitly:
-xarch=[v8plusc|v9c] for the SPARC64 VI fused multiply-add instructions set architecture
-xarch=[v8plusv|v9v] for privileged and hyper-privileged code
-xarch=sparcfmaf
You must also specify -m32 or -m64 when you specify -xarch=sparcfmaf to get 32-bit code or 64-bit code respectively . When you specify -xarch=sparcfmaf, the compiler predefines the following new values:
-D__FP_FAST_FMA__
-D__FP_FAST_FMAF__
Note: You must use -xarch=sparcfmaf in conjunction with the new -fma=fused option detailed below and some optimization level in order for the compiler to find opportunities to use the multiply-add instructions automatically.
-fma={none,fused}
The none value indicates that the compiler should not generate any floating-point, fused, or multiply-add instructions. The fused value allows the compiler to attempt to find opportunities to improve the performance of the code by using floating-point, fused, or multiply-add instructions.
COMPLETE DOCUMENTATION ON THE SUN STUDIO PORTAL