• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: PowerPC optional instructions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >PowerPC optional instructions (From: Os <email@hidden>)
 >Re: PowerPC optional instructions (From: Urs Heckmann <email@hidden>)
 >Re: PowerPC optional instructions (From: Os <email@hidden>)
 >Re: PowerPC optional instructions (From: Pavol Markovic <email@hidden>)

  • Prev by Date: Re: PowerPC optional instructions
  • Next by Date: Re: Component from ComponentInstance?
  • Previous by thread: Re: PowerPC optional instructions
  • Next by thread: Component from ComponentInstance?
  • Index(es):
    • Date
    • Thread