Saturday March 20, 2010 6:13 AM AEST

Inside AMD's latest CPU instruction sets

  • Email a Friend
  • Print Page
Inside AMD's latest CPU instruction sets
By The Inquirer
May 12, 2009 | 2 Comments
Tags: amd | intel | cpu | instructions | sets | fusion

Is this the first sign of what AMD's Fusion platform will look like?

A few days ago, AMD announced that it would support Intel's AVX instruction set rather than continuing on with SSE5. This stops any fragmentation and lets the best implementation win.

SSE5 is a superset of AVX. AMD put the bits not covered in another ISA called XOP, so with one exception, SSE5 became AVX + XOP. When Sandy Bridge and Bulldozer come out, we will get a chance to see how each one is done, and what the various strengths and weaknesses are.

The one difference seems pretty silly. Intel updated the AVX spec in January and changed an instruction called Fused Multiply Add (FMA) from a four operand instruction to a three operand; lets call them FMA4 and FMA3 respectively.

FMA is an operation that multiplies two numbers then adds it to a third. It looks like (A * B) + C. The difference between the -3 and -4 versions is where the result ends up. If you think of A, B and C as registers, FMA3 is (A * B) + C = C while (A * B) + C = D. AMD's version puts the result in a fourth register, Intel's overwrites register C.

If you ask AMD, it will say that FMA4 saves you a copy after the operation. Intel will likely say that you don't need to move the result. One thing is clear though, if you need to do a lot of operations, like (A * B) + constant, the AMD method will save you a bunch of cycles. That said, there are technical tradeoffs to both methods.

This one op defines the differences between Intel's AVX and AMD's AVX, and it is something that any compiler can easily work around. What will be interesting is seeing if Intel's professed compiler detente will take this into account. Time will tell.

The rest of SSE5 ended up in a set of opcodes called XOP. You can read about them in an AMD blog here. A few interesting ones to check out, Integer Multiply/Accumulate (IMA), Byte Permute (BP), Bit-wise Conditional Move (BCM), and Half-Precision Convert (HPC).

IMA is interesting because it allows you to do a traditionally FP calculation with 128-bit integers. The next two, BP and BCM are somewhat similar. BP takes bytes from two 16-bit vectors and copies them to a destination using a third vector as a mask. It can also twiddle the bytes as it copies them. BCM is similar, but it uses bits, not bytes, and obviously you can't twiddle a single bit much.

The last one, HPC, has it's own extension called CVT16, and that carries a CPUID flag as well. The short story is that it will convert between half and full precision on loads and stores with control over rounding and denorms.
This may seem like a yawner, but stop and think about this, why would one single instruction need it's own ISA name and CPUID flag? Well, the instruction is very useful in graphics and setting up pixels. Top it off with denorms being a part of DX11 and... and it doesn't take a genius to see the beginnings of the fusion ISA.

All in all, AMD did the right thing here in preventing ISA fragmentaion, and a mild slap on the wrist to Intel for changing the spec so late in the game. That said, AMD seems to have the better ISA on paper, but paper is not CPU performance.

The real test will be in the products that use them. Did one side implement it as a two pass 128-bit operation and the other 256-bit one pass? Is one a vastly better implementation? Does FMA4 do a lot better performance-wise than FMA3? These are open questions, and we will be unlikely to know the answer for sure until early 2011.

 

theinquirer.net (c) 2009 Incisive Media

 
Want to check out the first Australian review of Final Fantasy XIII? We got in this month's Atomic!

Plus HD projectors, Napoleon: Total War, Intel's new six-core processor, PC upgrading guide, and a whole lot more.

ON SALE NOW!
2 Comments
Thoughts on this article? Add a comment below.
ozacube
May 12, 2009 11:04 AM
I can't believe it, an Inquirer article that was actually informative, helpful and not full of biased drivel!

What's the world coming to?!
PAPA600
May 12, 2009 12:20 PM
And what did any of that actualy mean? i understood about only half of any of that...whats a BCM or a FMA4???
Login or register to submit a comment.
 
 
Atomic Magazine

Issue: 111 | April, 2010

Atomic is a magazine aimed squarely at computer enthusiasts, gamers, and serious PC upgraders.

Every month we bring you the latest reviews of new technology and PC components, in depth features on everything from overclocking to console hacking, and gaming previews and interviews.
 
Latest Comments
"RAGE!!!"
by Hawkeye | Mar 20, 2010 1:24 AM
 
"alex - bugger all. 78mg of caffeine. About the same as a cup of instant coffee. Taurine, Gurana ..."
by tantryl | Mar 20, 2010 12:51 AM
 
"Yummy yummy yummy om nom nom nom nom nom nom nom

GB"
by Ghost_Bear | Mar 19, 2010 11:59 PM
 
"Hawkeye: So if noone said anything about it you wouldn't think anyone cared and you would leave ..."
by fliptopia | Mar 19, 2010 10:05 PM
 
"I really want to try one of these out.
If anyone has one let me know how it goes."
by Dan_2 | Mar 19, 2010 7:24 PM
 
1) Sony Ericsson Aino6 plans 17%
2) Nokia E7147 plans 17%
3) Apple iPhone 3GS 32GB36 plans 17%
4) Apple iPhone 8GB43 plans 1%
5) HTC Magic5 plans 17%
1) Optus41 plans 11%
2) Vodafone7 plans 7%
3) Telstra BigPond30 plans 3%
4) iiNet32 plans 8%
5) Dodo34 plans 1%

Mobiles | Broadband | Credit Cards

Haymarket - Atomic MPC
Latest User Reviews
Logitech MX518 Gaming-Grade Optical Mouse
90%
Good shape, design and Ergonomics
 
Coolermaster HAF 922
100%
A case to make a statment and give your pc the Heavy Hardcore Grunt it needs.
 
Coolermaster Excalibur
50%
Atomic is under attack
 
XFX 9300 Motherboard
40%
HUGE letdown
 
CM Storm Sentinel gaming mouse
90%
Sexy and instant geek respect.