On Tue, Mar 30, 2010 at 10:34 AM, jf simon <j...@themis.com> wrote:
> Hi,
>
> Bart Smaalders wrote:
>>
>> The libc mem* routines already use VIS instructions to good effect on
>> SPARC platforms, and platform teams regularly enhance these functions
>> for both existing and new hardware.
>
>
> i want to use these VIS enhanced mem* functions on a Niagara T2
> system.  do i need to specify specific options for sun studio in
> CFLAGS? like "-sparcvis" ? or is it just a matter of linking with
> the right libc?
> in short how to be sure i am indeed using VIS?



Hello Jean,


for gcc the answer is:

http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
-mvis
-mno-vis
    With -mvis, GCC generates code that takes advantage of the
UltraSPARC Visual Instruction Set extensions. The default is -mno-vis.


for Studio:


On Studion VIS gets automatically compiled in, as long as your target
ISA is higher than the original UltraSPARC I  (aka sparcv9 [for 32bit
bins sparcv8plus]), which did not yet have VIS.
Everuthing equal or higher than sparcv9a [for 32bit bins sparcv8plusa]
automatically compiles VIS support in.

Here the proof:

http://docs.sun.com/app/docs/doc/820-7599/6nirkt7r0?a=view

@@@sparc@@@
Compile for the SPARC-V9 ISA, but without the Visual Instruction Set
(VIS), and *without* other implementation-specific ISA extensions.
This option enables the compiler to generate code for good performance
on the V9 ISA.


@@@sparcvis@@@
Compile for SPARC-V9 plus the Visual Instruction Set (VIS) version
1.0, and with UltraSPARC extensions. This option enables the compiler
to generate code for good performance on the UltraSPARC architecture.



@@@sparcvis2@@@
Enables the compiler to generate object code for the UltraSPARC
architecture, plus the Visual Instruction Set (VIS) version 2.0, and
with UltraSPARC III extensions.


@@@sparcfmaf@@@
Enables the compiler to use instructions from the SPARC-V9 instruction
set, plus the UltraSPARC extensions, including the Visual Instruction
Set (VIS) version 1.0, the UltraSPARC-III extensions, including the
Visual Instruction Set (VIS) version 2.0, and the SPARC64 VI
extensions for floating-point multiply-add.

You must use -xarch=sparcfmaf in conjunction with fma=fused and some
optimization level to get the compiler to attempt to find
opportunities to use the multiply-add instructions automatically.


@@@v8plus@@@
Compile for the V8plus version of the SPARC-V9 ISA. By definition,
V8plus means the V9 ISA, but limited to the 32–bit subset defined by
the V8plus ISA specification, ***without*** the Visual Instruction Set
(VIS), and without other implementation-specific ISA extensions.
This option enables the compiler to generate code for good performance
on the V8plus ISA.
The resulting object code is in SPARC-V8+ ELF32 format and only
executes in a Solaris UltraSPARC environment—it does not run on a V7
or V8 processor.

      Example: Any system based on the UltraSPARC chip architecture


@@@v8plusa@@@
Compile for the V8plusa version of the SPARC-V9 ISA. By definition,
V8plusa means the V8plus architecture, plus the Visual Instruction Set
(VIS) version 1.0, and with UltraSPARC extensions.
This option enables the compiler to generate code for good performance
on the UltraSPARC architecture, but limited to the 32–bit subset
defined by the V8plus specification.
The resulting object code is in SPARC-V8+ ELF32 format and only
executes in a Solaris UltraSPARC environment—it does not run on a V8
processor.

      Example: Any system based on the UltraSPARC chip architecture



@@@v8plusb@@@
Compile for the V8plusb version of the SPARC-V8plus ISA with
UltraSPARC III extensions.
Enables the compiler to generate object code for the UltraSPARC
architecture, plus the Visual Instruction Set (VIS) version 2.0, and
with UltraSPARC III extensions.
The resulting object code is in SPARC-V8+ ELF32 format and executes
only in a Solaris UltraSPARC III environment.
Compiling with this option uses the best instruction set for good
performance on the UltraSPARC III architecture.




@@@v9a@@@
Is equivalent to -m64 -xarch=sparcvis and is provided for
compatibility with earlier releases.


@@@v9b@@@
Is equivalent to -m64 -xarch=sparcvis2 and is provided for
compatibility with earlier releases.


As I recommended yesterday: man gcc and man cc    ...





%mab
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to