• 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
vpowf parameters backwards on Intel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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...



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.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: vpowf parameters backwards on Intel?
      • From: Eric Albert <email@hidden>
  • Prev by Date: Re: huge temporary files
  • Next by Date: [ADMIN] Re: Database Development
  • Previous by thread: framework deadstrip?
  • Next by thread: Re: vpowf parameters backwards on Intel?
  • Index(es):
    • Date
    • Thread