Re: Compiling simple C code filters to use AltiVec
Re: Compiling simple C code filters to use AltiVec
- Subject: Re: Compiling simple C code filters to use AltiVec
- From: Shawn Erickson <email@hidden>
- Date: Wed, 14 Dec 2005 12:44:21 -0800
On 12/14/05, Robin Lake <email@hidden> wrote:
> I have a number of relatively simple C code "filters" dating back to
> the 1970's. They compile and run fine using "cc" in Terminal under
> OS X. One, in particular, uses a lot of math and I would like to
> recompile it to use the AltiVec processor in my G5.
>
> The tutorials for XCode start off assuming one is building a project,
> which is a step above what I am used to doing.
>
> Is there a simple, straightforward way to compile my filter and
> assure it will use the AltiVec?
Adding to what Chris pointed you at... you could attempt to leverage
auto-vectorization capability of the GCC 4.0+ compiler but how much
vectorization is possible depends greatly on what your code is doing.
Search in the following for "Auto Vectorization".
<http://developer.apple.com/releasenotes/DeveloperTools/GCC4.html>
To get the most "bang for the buck" from AltiVec (or SSEx) you will
have to do more then just recompile your code. You will have to rework
your code to be vector based and doing that takes a little art
(depending on what you are trying to do). Apple provides various
vector based libraries for you as well as many resources to understand
how to do vectorization... These libraries support AltiVec now, likely
will support SSE soon and can fall back to non-vector purpose
functional units as needed. Chris started you onto that path in the
documentation.
-Shawn
_______________________________________________
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