sys_optimize() and SSE

Dec 27, 2006 at 11:02am

sys_optimize() and SSE

Hi there,

I am in the process of converting all my AltiVec
perform methods to SSE.
I am on a Mac PowerBook Pro Intel Core Duo and I am
wondering if I can rely on sys_optimize() to have the
same behavior that it used to have on PowerPCs with
AltiVec.

The conditions for sys_optimize() to return true on
PowerPCs are:

1. Altivec-capable machine
2. User has checked Optimize in the DSP Status window
3. Signal Vector size is a multiple of 4

Is it the same on Intel with SSE or not ?
If not what’s the best way to integrate SSE vector
code into your external ?

Any comment or suggestion highly appreciated.

Thank you.

- Luigi

————————————————————
THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. ANY UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE SENDER BY E-MAIL AT SUPERBIGIO@YAHOO.COM AND DESTROY ALL COPIES OF THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC1-207.
————————————————————

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

http://mail.yahoo.com

#29386
Dec 27, 2006 at 11:15am

Dear Luigi

> The conditions for sys_optimize() to return true on
> PowerPCs are:
>
> 1. Altivec-capable machine
> 2. User has checked Optimize in the DSP Status window
> 3. Signal Vector size is a multiple of 4

As I said in the other thread, I cannot get sys_optimize() to return
false on my system… have your tried it lately ? Please refer to
the other thread for a description of the problem…

pa

#91785
Dec 27, 2006 at 11:36am

I just tried calling sys_optimize() both with Optimize
On and Off. Yes, I do recompile the DSP chain after
changing the Optimize option in the DSP status
window… and it always returns false on my system, no
matter what… It kind of makes sense, since the
function was originally developed for AltiVec capable
machines, and my machine (Mac Powerbook Intel Core
Duo) is not AltiVec capable.

What system are you on ?

- Luigi

— Pierre Alexandre Tremblay

wrote:

> Dear Luigi
>
> > The conditions for sys_optimize() to return true
> on
> > PowerPCs are:
> >
> > 1. Altivec-capable machine
> > 2. User has checked Optimize in the DSP Status
> window
> > 3. Signal Vector size is a multiple of 4
>
> As I said in the other thread, I cannot get
> sys_optimize() to return
> false on my system… have your tried it lately ?
> Please refer to
> the other thread for a description of the problem…
>
> pa
>

————————————————————
THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. ANY UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE SENDER BY E-MAIL AT SUPERBIGIO@YAHOO.COM AND DESTROY ALL COPIES OF THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC1-207.
————————————————————

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

http://mail.yahoo.com

#91786
Dec 27, 2006 at 11:43am

#91787
Dec 27, 2006 at 11:46am
#91788
Dec 27, 2006 at 2:03pm

#91789
Dec 27, 2006 at 4:53pm

Quote: Luigi Castelli wrote on Wed, 27 December 2006 04:02
—————————————————-

> 1. Altivec-capable machine
> 2. User has checked Optimize in the DSP Status window
> 3. Signal Vector size is a multiple of 4
>

Hi Luigi. The deal with SSE and sys_optimise() as you’ve already discovered seems to be that it is cuurently not reliable. However, in the case of the three above, only 2 is problematic, as this is not something you can discover any other way (asfaik). 3 could be checked manually in the dsp routine and 1 (or the equivalent – SSE present) is guaranteed on a mac as it is a requirement of the OS. To be absolutely clear it is only SSE2 (which is everything except a few operations) not SSE3 – this is covered in the basic apple docs for SSE somewhere….)

On a PC(or rather windows) of course you probably need to do some other kind of test that I can’t help you with I’m afraid.

Oh, I almost forgot – you may need to get the precompiler to recognise whether it is compiling for intel or ppc in order to do some stuff as a proper universal binary because code will not comile for sse on ppc or altivec on intel – this can be done with the #if below. It *may* be possible to use the accelerate framework for everything to get code that will compile on both, but I’ve been unable to work out what routines to call to get basic operations like multiply and add without calling platform-specific routines, so I use macros to do this which get replaced according to the platform. If anyone knows how to do this via the framework I’d be grateful to know, but of course you may prefer a pre-compiler approach, as it might be easier to get code that will work on windows as well…

#if (TARGET_RT_LITTLE_ENDIAN)

returns true for intel under mac os and false under ppc

Regards

Alex

#91790

You must be logged in to reply to this topic.