VIS or not, removing all the code which checks for alignment and size to pick an optimized code path would be a win even for the icache. The discussion however is only theoretical because ON uses Sun Studio and not gcc as primary compiler and Studio has no option to inline memcpy() or strcpy() for known size and alignment, leaving as last resort only hand written assembler.
The application is no micro benchmark, it is a real application which does many string operations. Olga 2010/3/30 Bart Smaalders <bart.smaald...@sun.com>: > On 03/29/10 15:41, ольга крыжановская wrote: >> >> 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 > > I would be surprised if VIS offered any real advantages in > copies of less than 48 bytes; perhaps if the copies are > misaligned VIS may help. Be very careful about inlining > memcpy; while this improves performance on microbenchmarks, > the adverse effects of icache hit rate on real world code > generally leads one in the other direction. -- , _ _ , { \/`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