OS X x86 + AltiVec == Too bad

Ok I thought this probably deserved a post of its own.

I’ve just been playing with Rosetta under OS X running on x86. Its all working as well as can be expected and I’m currently running a number of apps that were compiled for PowerPC (Firefox, iTunes etc). This is using the Rosetta engine which inturn (I’ve been told) uses the processors SSE3 capabilites to perform any required interpretations.
A question that had been on my mind ever since I heard about Apples move to Intel was whether or not code utilising PPCs Altivec instruction set would work on the new platform. I’ve read a lot of different things from people saying that it will be supported by Rosetta or it won’t or it will have shocking performance issues etc but I wanted to see once and for all.

Well from what I’ve just discovered the answer is a resounding NO, it will not run!

I’ve taken very simple programs that use Altivec instructions, compiled and tested them on the trusty G4 and then moved the binary over to my P4. Upon running these however I simply get an error stating:
“Illegal instruction”
Remember that when Apple made the announcement about moving to Intel they said that at most a recompile of code would be required.
Well I then took the code and tried recompiling it under OS X x86 using the gcc -faltivec argument and was unsurprised to find that this didn’t work either, simply returning an error stating:
test.c: In function `main’:
test.c:8: error: `vector’ undeclared (first use in this function)

Well so much for a smooth transition for anything using Altivec.

Testbed:
Intel P4 (Prescott) 2.8
512mb Ram
80gb SATA drive
The examples i tried are those off the Apple website at http://developer.apple.com/hardware/ve/tutorial.html

2 thoughts on “OS X x86 + AltiVec == Too bad”

Leave a Reply

Your email address will not be published. Required fields are marked *