AltiVec Unwrapped
paradesign writes "O'Reilly is running a nice article on AltiVec in the G4 chip. The article includes examples, with code, showing its effectiveness. For everyone who is uneducated as to exactly what Altivec is, this is a must read."
This is a good article giving a basic overview of SIMD coding using altivec. However, when Apple claims that MHz don't matter, they're only telling the story, because SSE (on PIII and Athlon4/XP), 3DNow! on K6-2, K6-3 and Athlon all do much the same thing. I hate to say it, but the Pentium IV even has double-precision SIMD in the form of SSE2, currently the only consumer-grade processor with souble-precision SIMD. The AMD Hammer will have SSE2 as well when it comes out.
I'm out of my tree just now but please feel free to leave a banana.
You will also find faradic temperature measurement in such fields physical proton bombardment, torque pressurization and shotput.
Just buy an Athlon XP. It runs at 1.67GHz and does SSE (128-bit SIMD registers holding 4 32-bit floats) and 3DNow! (64-bit MMX registers used to hold 2 32bit floats).
I'm out of my tree just now but please feel free to leave a banana.
google is your friend.
What do you mean by "support under LinuxPPC"?
If the kernel knows about the registers, it can preserve them during context switches. I'd imagine this trivial kernel mod was done years ago.
As for general programming, you're right about gcc. There isn't much vectorisation in gcc (c.f. intel's cc which vectorises for SSE2 on PIV) so I (with unrealistic self-confidence as usual) set about writing a C library of vector, matrix, complext etc. functions to use the SIMD features of K6-2/3, Athlon, PIII, PIV and PPC a while ago, and to provide a plain C implementation for folks without SIMD. If you want to help, have a look here.
I've only done 3DNow and C so far for a small number of functions, but one or two people are already interested.
I'm out of my tree just now but please feel free to leave a banana.
Ars Technica did an article comparing the AltiVec and SSE/MMX2/3DNow! architectures. Written a while back, but still valid as the architectures have not changed.
--Paul
You don't have to write in assembler or get a newer compiler. Just get libsse . It provides a similar programming interface to apple's hack of GCC. The same author also wrote a libmmx, but that is fairly useless since MMX is so poor.