-ftree-vectorize in XCode (with GCC)

by Brian | 6th July 2009

Picture 2

So Shark is telling you to use the “-ftree-vectorize” flag setting in GCC to squeeze out some floating point performance, yeah? You want to find out how to do that? Yeah… join the club.

(First, don’t search on “-ftree-vectorize” in Google as Google will think you *do not* want to use the keyword “ftree-vectorize” becasue of the minus sign. Then again, I’m sure you have figured this out.)

Okay, I found the answer here: Working with Xcode Build Settings

In summary: right click on your project in the “groups & files” column and click “Get info”:
Picture 3

Then put in -ftree-vectorize for “Other C flags” in the “Build” tab (like so):
Picture 2

A few reference links:
the GCC man page
this guy who looks like he’s doing some speed-focused compilations

Leave a Reply

Name (Required)

Email (Required - will not be published)

Website

Message (Required)