• 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
Re: enabling altivec in XCode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enabling altivec in XCode


  • Subject: Re: enabling altivec in XCode
  • From: john <email@hidden>
  • Date: Wed, 2 Feb 2005 18:49:27 -0500

Hi Ian,

Rubbish, I think not :)

I was just mistaken about __VEC__ being already defined, and I assumed this because he said he had altivec code generation (-faltivec) enabled in his project settings. The java mode I was referring to is what the vDSPSample code uses __VEC__ for (according to my quick perusal), perhaps you misunderstood on that part.

-- John


That is rubbish.

The __VEC__ C preprocessor symbol is turned on automatically when the compiler is passed -faltivec. All __VEC__ means is that -faltivec was passed, which in turn means that the AltiVec C Programming interface has been turned on. It is a switch for controlling whether or not code is compiled and has nothing to do with java mode. Mostly it is used to stop vector code from causing compile time errors on non-AltiVec targets, for example when compiling code that is intended to be run on x86 on a cross platform app.

The problem here is really due to the way that ZeroLink works. There is no compile/link time check for absent functions. Because -faltivec was not passed, __VEC__ was never defined, which means that HasAltivec() was never compiled. The crash occurs when the code branches to a NULL function pointer.

My suggestion is two fold:

1) liberate HasAltiVec() implementation and declaration from the #ifdef __VEC__ block so that it is compiled regardless of whether __VEC__ is defined. That particular function works whether AltiVec is available or not, so it doesn't need to be protected by __VEC__. If you want, you can set it up to always return false if __VEC__ is undefined. There wouldn't be any vector code to call in that case.

2) If you intend to write your own AltiVec code using the AltiVec C Programming Interfaces, turn on the AltiVec C Programming Interfaces using the -faltivec flag. They are not turned on in xcode by default. You don't need -faltivec to use libraries that use altivec code.

You possibly might want to turn off ZeroLink to see what other link problems you have.

On a side note, unless you're specifically writing altivec code, the
accelerate framework chooses the vector or scalar implementation for
you. You don't even need to enable altivec code generation.

..which is correct.

Ian Ollmann

_______________________________________________
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
References: 
 >Re: enabling altivec in XCode (From: Ian Ollmann <email@hidden>)

  • Prev by Date: Re: enabling altivec in XCode
  • Next by Date: k8BitOffsetBinaryFormat in ASBD question
  • Previous by thread: Re: enabling altivec in XCode
  • Next by thread: MatrixMixer input errors
  • Index(es):
    • Date
    • Thread