The new gcc 4.0 compiler shipped with Apple’s Mac OS X 10.4 makes use of a new component, the loop vectorizer. This allows gcc to compile code that will take advantage of altivec optimizations without the need for the developer to explicitly use altivec code.
is this gonna be included in native GCC 4 aswell? i’d gladly take a performance boost for most apps. probably still have to recompile everything as the distributions ship code that isn’t compiled for altivec at all (G3-compatibility)
“i think it’s illegal distribute binaries of an GPL licensed program without distribute the source”
Read the license. it says no such thing.
“Relevant” parts of the GNU GPL. For the whole license, follow link at bottom.
“For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.”
“3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange;”
ref: http://www.gnu.org/copyleft/gpl.html
Should be available here: http://www.opensource.apple.com/darwinsource/10.4/
I haven’t taken the time to verify if the autovectorization stuff is in that version of gcc though.
The article is about native GCC, not the Apple version. The work is being done by the GCC group, not only by Apple. There is already support for other platforms, such as MMX, as this autovectorization is performed at the tree-ssa level. No bad news here.
Yes, it’s in gcc4.0. But it isn’t very good yet, and you won’t get much of a performance boost from it. Take a look at all the enhancements going into it for 4.1 (hopefully).
http://gcc.gnu.org/wiki/Autovectorization%20Enhancements
I aplogize, I posted before reading the article and gave the same link… Now I’m embarrassed.
Show you the code of shut up…it doesn’t exist if you don’t see the code? Guess Windows XP doesn’t exist.
LOL XP is a figment of our imaginations,the numerous reinstalls aren’t though…
Apple’s marketing department 0wns you. Auto-vectorization is a GCC feature implemented largely by IBM Research Labs at Haifa. That is not to say that Apple didn’t contribute (one of their engineers worked on it too), but every article about autovectorization makes it seem like Apple wrote the code and graciously donated it to the GCC folks.
“IP: —ptr.hqda.pentagon.mil” right where exactly are you and why are you not working so as to ensure my safety.
But seriously should you really be posting on osnews with an IP like that.
with my powerbook and the result is that performance is roughly comparable to an opteron, given that the result is properly scaled by the clock frequency ratio.
I found out, though, that the fortran compiler is a little bit bitchy about code. It very easily refuses to compile code that compiles on many different systems (HP/UX Compaq Visual Fortan on windows etc.)
cheers
Ok, I am not a devloper but I sort of understnad this. Software compliled using this can get altavic support (at least some) without specificly coding for it. So, what about x86 and MMX, SSE etc…
MMX, SSE, 3DNow, etc. all get code automatically as well. They only singled out Altivec because they were talking about Tiger. Visual Studio can do the same thing, but most projects don’t use it because it would limit the code to running on newer processors.
You need to set the right compiler flags to take advantage of these optimizations. Most commercial vendors at times avoid setting these flags to ensure their executable objects run on more CPU architectures.
In fact, to date, Gentoo is the only operating system I know of that provides for advanced and consistent compiler tweaks and optimizations across the operating system in a standard manner.
Fortunately, on the Macintosh platform, OS X in particular, software vendors can set the optimization flag for the loop vectorizer without worrying about the portability of their executable objects because all the CPU architectures that OS X runs on, officially, provide support for such optimizations.
In fact, to date, Gentoo is the only operating system I know of that provides for advanced and consistent compiler tweaks and optimizations across the operating system in a standard manner.
But on the other hand, only a very small fraction of typical applications have well vectorizable loops. This is easily verified with a vectorizing compiler, e.g. with the Intel Compiler on x86 platforms. Interactive applications usually also features the user as the biggest (and not vectorizable) brake.
Few Linux applications that gain noticably with an vectorizer are e.g. GIMP or PovRay.
For the rest, to generate a few rarely used vectorized loops that has no significant impact on speed but portability is a bad trade-off for most (binary) distributors.
“Fortunately, on the Macintosh platform, OS X in particular, software vendors can set the optimization flag for the loop vectorizer without worrying about the portability of their executable objects because all the CPU architectures that OS X runs on, officially, provide support for such optimizations.”
Anything compiled with the vectorizer will only run on G4’s and newer. Altivec isn’t vaible on older ppc CPU’s such as the G3 and Mac OS X still runs on G3’s.
Nice of you to leave off quoting as soon as it no longer supported your point. In addition to distributing it with sourcecode, one may also
“b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)”