Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: optimizing sin() on Intel and PowerPC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: optimizing sin() on Intel and PowerPC




On Sep 5, 2006, at 11:59 AM, Artemiy Pavlov wrote:

Hello Ian,

and thanks a lot for the reply.

Yes, it is a normal function. You don't even need to turn on vector extensions in the compiler if you don't want to.

Ian, I tried this test code to obtain a single sine:

	float SineInput[1], SineOutput[1];

	SineInput[0] = M_PI;

	vvsinf( SineOutput, SineInput, 1);

But I get:

Waveforms.h:22: error: invalid conversion from 'int' to 'const int*'
Waveforms.h:22: error: initializing argument 3 of 'void vvsinf (float*, const float*, const int*)'


Could you possibly suggest what I am doing wrong with the third parameter?

void vvsinf (float * /* y */, const float * /* x */, const int * /* n */) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;


	float SineInput[1], SineOutput[1];
	int length = 1;
	vvsinf( SineOutput, SineInput, &length );

It will not be fast in this particular usage. The speed doesn't really come in until length is at least four, and much better when it is at least 16 and the data is 16 byte aligned.

Ian


_______________________________________________ Do not post admin requests to the list. They will be ignored. PerfOptimization-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >optimizing sin() on Intel and PowerPC (From: Artemiy Pavlov <email@hidden>)
 >Re: optimizing sin() on Intel and PowerPC (From: Ian Ollmann <email@hidden>)
 >Re: optimizing sin() on Intel and PowerPC (From: Artemiy Pavlov <email@hidden>)
 >Re: optimizing sin() on Intel and PowerPC (From: Ian Ollmann <email@hidden>)
 >Re: optimizing sin() on Intel and PowerPC (From: Artemiy Pavlov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.