Re: PowerPC optional instructions
Re: PowerPC optional instructions
- Subject: Re: PowerPC optional instructions
- From: Shaun Wexler <email@hidden>
- Date: Wed, 26 May 2004 14:47:06 -0700
On May 26, 2004, at 1:00 PM, Pavol Markovic wrote:
>
If you look into motorola/ibm cpu tech specs you'll find the answer.
>
If I remember right it's implemented in G3/G4/G5 CPU's.
Yes.
>
My question is, how to use this instruction - asm block in C code?
#import <ppc_intrinsics.h>
Two rounds of Newton-Raphson result in 24-bits of precision, though one
is usually sufficient on G4, and sometimes none on a G3:
static inline float recip(float val)
{
register float one = 1.0f;
register float est = __fres(val);
est = __fmadds( __fnmsubs( est, val, one ), est, est );
est = __fmadds( __fnmsubs( est, val, one ), est, est );
return est;
}
static inline vector float vec_recip( vector float v )
{
register vector float one = vec_ctf( vec_splat_u32(1), 0 );
register vector float est = vec_re( v );
est = vec_madd( vec_nmsub( est, v, one ), est, est);
est = vec_madd( vec_nmsub( est, v, one ), est, est);
return est;
}
Don't forget to unroll these functions enough to saturate the
pipelines...
--
Shaun Wexler
MacFOH
http://www.macfoh.com
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.