The libc mem* instructions use VIS but they are still suboptimal for
small fixed size copies because they impose a significant overhead by
*always* testing the size and alignment. For copies smaller than 48
bytes the overhead is even greater than the size of data copied,
making it inefficient compared to an inlined chain of VIS
instructions.

Olga

On Mon, Mar 29, 2010 at 8:41 PM, Bart Smaalders <bart.smaald...@sun.com> wrote:
> On 03/27/10 19:34, ольга крыжановская wrote:
>>
>> I am looking for a Sun Studio C example for inline SPARC assembler
>> which uses the VIS 'block copy' instruction to move a block of<n>
>> bytes. Has anyone time to write such an example for me, please?
>>
>> Olga
>
> In general, be very cautious in going down this route.  The optimum
> (or even working) sequence of instructions can and will vary across
> platforms, so what works well on one family of CPUs may be distinctly
> non-optimal on another.
>
> 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.
>
> If you decide to pursue this, consider using the new linker capabilities
> code that Rod Evans recently integrated; this allows the runtime
> linker to select the appropriate version of your routine for the
> current platform.
>
> - Bart
>
> --
> Bart Smaalders                  Solaris Kernel Performance
> bart.smaald...@oracle.com       http://blogs.sun.com/barts
> "You will contribute more with mercurial than with thunderbird."
> _______________________________________________
> opensolaris-code mailing list
> opensolaris-code@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     olga.kryzhanov...@gmail.com   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to