| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| 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... Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! quadrium | build, mutate, evolve | images, textures, backgrounds, art |
_______________________________________________ Do not post admin requests to the list. They will be ignored. PerfOptimization-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.