Ian, as far as I understand you suggest code to change the sign of each
other element.
Thanks for a nice example, I didnt figure that instead of adding "1" i
could subtract -1.
I am using permute unit to swap real and imaginary interleaved parts.
As far as I understand, i would need vec_rl or permute to swap real and
imaginary part anyway.
Also, thanks for a trick on how to constract "0x0, 0xFFFF, 0x0,
0xFFFF...." mask.
I suppose that it is more fast to synthesize constant on altivec
instead of read it from memory, right?
By the way, why the addition in your code is saturated?
--
Sincerely,
Rustam Muginov
On Nov 28, 2005, at 8:04 AM, Ian Ollmann wrote:
You don't actually need the permute unit. This frees it up to handle
other things like misalignment:
//set up a constant -- do once
vector signed short mask = vec_mergeh( vec_splat_s16( 0 ),
vec_splat_s16(-1) ); // 0X0, 0XFFFF, 0X0, 0XFFFF...
//the two cycle way to do it
v = vec_xor( v, mask );
v = vec_subs( v, mask );