Re: CoreAudio Level Of Death
Re: CoreAudio Level Of Death
- Subject: Re: CoreAudio Level Of Death
- From: Urs Heckmann <email@hidden>
- Date: Fri, 12 Nov 2004 20:46:03 +0100
Doug Wyatt:
I havn't found any information about latencies when moving comparison
results from the Condition Register into an Integer Register. I guess
it's a normal 1-cycle latency move? (Or better, I hope so ;-)
Shark or amber/acid would say for sure, but that looks OK, you're not
doing any float<->int conversions. I'd also look to see if there are
hidden branches in the comparison against 0x7F800000.
You were right... gcc generates hidden branches from the code I
posted...
... but it doesn't generate any branches inside the loop if you a) use
gt/lt comparisons in seperate integers and b) don't put braces (!)
around them:
void erase_All_NaNs_Infinities_And_Denormals( float* inSamples, int&
inNumberOfSamples )
{
UInt32* inArrayOfFloats = (UInt32*) inSamples;
for ( int i = 0; i < inNumberOfSamples; i++ )
{
UInt32 sample = *inArrayOfFloats;
UInt32 exponent = sample & 0x7F800000;
int NoNaN = exponent < 0x7F800000; // <- no braces (...) here,
otherwise branch!
int NoDen = exponent > 0;
*inArrayOfFloats++ = sample * ( NoNaN & NoDen ); }
}
:-p
Cheers,
;) Urs
_______________________________________________
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