• 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: sin() optimization on PowerPC and Intel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sin() optimization on PowerPC and Intel


  • Subject: Re: sin() optimization on PowerPC and Intel
  • From: James McCartney <email@hidden>
  • Date: Mon, 26 Jun 2006 10:32:41 -0700


If you include <TargetConditionals.h> you can use TARGET_CPU_X86 or TARGET_CPU_PPC.


This is more about coding DSP than about CoreAudio, so you might look for the answer on the music-dsp mailing list where this kind of thing has been discussed at length. You could also look at the music-dsp source code archive where there are a number of sine functions and oscillators.
http://www.musicdsp.org/



On Jun 26, 2006, at 8:37 AM, Artemiy Pavlov wrote:

Hello all!

I have the following problem. XCode 2.2, Mac OS 10.4.6 on Intel.

I created a sin() function replacement using four first members of the Taylor series - works perfectly like the standard sin() (the thing is that I need a very pure sine for FM purposes, so other models do not work ear-wise).

But the thing is that it doesn't work any faster than the standard sin() function... It's not optimized with assembly language, but anyway has no division operations and all coefficients are pre- computed. I heard that on Intels the sin() function is actually implemented in CPU instructions, and that is why it works so fast. Is this true?

So the question is - should I determine the CPU type for my universal app and use sin() on Intel and custom sin() on PPC? If so, are there any #define's available to be able to branch the code?

Thanks!


All the best,

Artemiy Pavlov
Sineshine http://sineshine.com



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


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
References: 
 >sin() optimization on PowerPC and Intel (From: Artemiy Pavlov <email@hidden>)

  • Prev by Date: sin() optimization on PowerPC and Intel
  • Next by Date: Re: Audio Units support for host applications
  • Previous by thread: sin() optimization on PowerPC and Intel
  • Next by thread: Re: sin() optimization on PowerPC and Intel
  • Index(es):
    • Date
    • Thread