Re: Endian stuff was: Re: SPDIF encoded output on G5
Re: Endian stuff was: Re: SPDIF encoded output on G5
- Subject: Re: Endian stuff was: Re: SPDIF encoded output on G5
- From: alex <email@hidden>
- Date: Wed, 30 Nov 2005 21:35:35 -0500
How about:
inline void SwapLong( register long& value, register long temp = 0 )
{
asm
{
// temp is 0 and is used as index initially
lwbrx temp, value, temp // load the value but byte swapped
stw temp, 0(value) // store that back
}
}
Don't know how this works in XCode... but you can still use lwbrx on all PPCs.
alex
At 2:11 AM +0100 12/1/05, Urs Heckmann wrote:
>Jeff Moore:
>
>>In fact, you might run into the exact same hardware you're doing it for now =)
>
>Btw... sorry for hijacking... does anybody have a super quick way for byte swapping an arbitrary number of longs/floats? Something like industrial strength dsp code?
>
>How would you implement this function on PPC and/or/vs. Intel:
>
>inline void swapEndian( UInt32 &ICameFromOuterSpace )
>{
> // ?
>}
>
>I think I saw a fancy trick years ago using shifts and exclusive or. But I can't remember.
>
>I guess the slowest must be using arrays of chars... as these might occupy a lot of registers... or not so?
>
>Cheers,
>
>;) Urs
>
>
>urs heckmann
>email@hidden
>www.u-he.com
>
>_______________________________________________
>Do not post admin requests to the list. They will be ignored.
>Coreaudio-api mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>
>This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden