Re: Byte Twiddling and Altivec
Re: Byte Twiddling and Altivec
- Subject: Re: Byte Twiddling and Altivec
- From: John Hörnkvist <email@hidden>
- Date: Mon, 6 Aug 2001 02:29:43 +0200
On Monday, August 6, 2001, at 12:42 AM, John C. Randolph wrote:
At the risk of prematurely optimizing something...
Given an array of 256 bytes and wanting to reverse them, what would be
the optimal way to do so with all of the tricks that Mac OS X on a G4
has to offer?
I've just found a description of vec_perm(), and it looks like it can
twiddle sixteen bytes any way I'd care to in one clock, but it looks
like GCC is choking on my attempt to declare a 'vector unsigned char'.
Can I cheat with asm{} within GCC?
Has anyone on this list done any Altivec permutations that they'd like
to share?
I've done a fair amount of AltiVec permutations for mpegToaster; AltiVec
code often needs a lot of extra instructions to set things up before you
do the actual work.
I have declarations like "vector unsigned char flipVector;" without
trouble.
Do you give the compiler the -faltivec flag?
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com