Sun Studio 12: Fortran Programming Guide

64-Bit x86 Platform Support

The Sun Studio Fortran compiler supports the compilation of 32-bit and 64-bit code for Solaris and Linux x86 platforms.

The -xtarget=pentium3 flag expands to: -xarch=sse -xchip=pentium3 -xcache=16/32/4:256/32/4.

For Pentium 4 systems, -xtarget=pentium4 expands to: -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8.

A new -m64 option specifies compilation for the 64-bit x64 instruction set.

A new -xtarget option, -xtarget=opteron, specifies the -xarch, -xchip, and -xcache settings for 32-bit AMD compilation.

You must specify -m64 after -fast and -xtarget on the command line to generate 64-bit code. The -xtarget option does not automatically generate 64-bit code. The -fast option also results in 32-bit code because it is a macro which also defines an -xtarget value. All the current -xtarget values (except -xtarget=native64 and -xtarget=generic64) result in 32- bit code, so it is necessary to specify -xarch=m64 after (to the right of) -fast or -xtarget to compile 64-bit code, as in:

% f95 -fast -m64 or % f95 -xtarget=opteron -m64

The compilers now predefine __amd64 and __x86_64 when you specify -xarch=amd64.

Additional information about compilation and performance on 32-bit and 64-bit x86 platforms can be found in the Fortran User’s Guide.