vpowf parameters backwards on Intel?
vpowf parameters backwards on Intel?
- Subject: vpowf parameters backwards on Intel?
- From: glenn andreas <email@hidden>
- Date: Mon, 24 Apr 2006 11:41:17 -0500
I've got an app that is vectorized, and I'm getting different results between Altivec/PPC and SSE/Intel builds. I've narrowed it down to a call to vpowf (as found in vecLib/vfp.h).
So if you take the following code:
#include <vecLib/vecLib.h> #include <stdio.h> int main(int argc, const char *argv[]) { #ifdef __VEC__ vFloat two = (vFloat)(2.0,2.0,2.0,2.0); vFloat > #else vFloat two = (vFloat){2.0,2.0,2.0,2.0}; vFloat > #endif vFloat sqrtTwo = vpowf(two, oneHalf); printf("%vf ^ %vf = %vf\n",two, oneHalf, sqrtTwo); return 0; }
compile and run on PPC: gandreas% gcc -faltivec -framework vecLib -o vpowfppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk vpowf.c gandreas% ./vpowfppc 2.000000 2.000000 2.000000 2.000000 ^ 0.500000 0.500000 0.500000 0.500000 = 1.414214 1.414214 1.414214 1.414214
Doing the same for i386: gandreas% gcc -arch i386 -framework vecLib -o vpowf386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk vpowf.c gandreas% ./vpowfi386 2.000000 2.000000 2.000000 2.000000 ^ 0.500000 0.500000 0.500000 0.500000 = 0.250000 0.250000 0.250000 0.250000
Looks like the parameters are backwards to me...
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden