Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fastest way to change sign of the odd elements of vSInt16



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 );

Ian


_______________________________________________ Do not post admin requests to the list. They will be ignored. PerfOptimization-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden
References: 
 >Fastest way to change sign of the odd elements of vSInt16 (From: Rustam Muginov <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Paul Russell <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Rustam Muginov <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Holger Bettag <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Rustam Muginov <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Holger Bettag <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Rustam Muginov <email@hidden>)
 >Re: Fastest way to change sign of the odd elements of vSInt16 (From: Ian Ollmann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.