MMX And Beyond

 






Motorola_Altivec.gif (22865 bytes)

 

Motorola's AltiVec - PowerPCs Have Fun Too

Motorola has released detailed specifications of their alternative, called AltiVec which will be used in Macintosh computers next year too. In contrast to Intel's thick veil of secrecy surrounding KNI, Motorola has released a preliminary specification of AltiVec, which can be found at their website along with more general information. Personally I decided that it wasn't worth destroying all those trees and printed the whole 356 page preliminary manual, but I need something to get me to sleep at night!

AltiVec is an extension to PowerPC processors, so PC people will not benefit from this one but at least they should know how it compares. And in an architecture which has not been around as long at the x86 family, there is more room to fit in new extensions with fewer limitations. So what have they put in?

There are 32 new registers of 128 bits each, allowing AltiVec to operate on:

  • 4 single precision floating point values or
  • 4 32 bit integers or
  • 8 16 bit integers or
  • 16 8 bit integers

A rich set of instructions operate on these registers, allowing standard arithmetic, logical operations, floating point arithmetic, and instructions to shuffle data around in the registers. For instance vperm allows you to put all of the 16 8 bit values in a register into any of the 16 positions in a destination register all at once. Also vsplat (I love the name) lets you put one value into all of the elements in a register - this is something I missed when writing MMX code.

The other major thing about AltiVec is the way memory is fetched - rather than just having one instruction which hints to the processor that it will access a particular memory address in the near future, AltiVec literally supports streams of data. A programmer can issue one instruction that says: "I want to read a chunk of memory at location 0x12345678 which is 20k long and then I'll read another block 100k after that and so on for 8 times (oh, and don't cache the memory because I'll only read it once)". This is a very powerful mechanism and allows a programmer to efficiently use memory bandwidth. I was talking about how vector processing started with supercomputers, and this is a very good example of one of the most important techniques from there.

There's a rumour that the first G4 processors with AltiVec will have two separate AltiVec units. This is promising and could potentially supply a peak processing rate of 3.2 GFLOPS (compared to the current ~0.3 GLFOPS from a Pentium II).

In summary, AltiVec looks like a very good, very clean and possibly very powerful multimedia extension. From the start it has integer and floating point instructions, the data stream instructions and enough registers (instead of limited to 8 as with MMX!) Unless Motorola produce a bad implementation of this I think it will make a big difference in programs which use it. We'll have to wait and see, but it has at least a running chance against Intel's KNI.

Moving on...

 

 
 

 

 
     
   

 

 
   

 
     
 

                   

 
   

 

 
 
Last Updated 01-01-2001

All trademarks used are properties of their respective owners.
Copyright © 1998-2000 Adrian Wong. All rights reserved.

 
Visit the new Tech ARP @ http://www.techarp.com/ !