On Mon, Mar 29, 2010 at 1: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."
Speaking of such things, one thing I've been curious ever since reading the various Sparc architecture manuals, is (if I understood and remember them correctly -- it's been a while now), you can load a 16, 32, or 64-bit value and using an appropriate ASI have it do an endian conversion for you (and that this can work for both kernel and user contexts, though perhaps different ASIs might be needed depending on the context). Is there any reason those couldn't/shouldn't be used? _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code