Question on AVX2 and FMA (Haswell)

phillyman36

Golden Member
Jun 28, 2004
1,789
200
106
Ok I tried my best to find the answer myself thru wiki, youtube, google searches and still dont know. Can someone tell me/explain
1) What is FMA is and what it does?(examples)
2) What AVX2 is and does? (examples)

I seem to find technical answers that I don't understand. In simple terms what do they help ie video encoding, gaming etc etc. How do they effect everyday computing? What software would benefit from these in Haswell (ie handbrake, photoshop)
Building a pc is simple. Understanding the the thing you all talk about and debate is a whole other level :)
Thanks for any help.
 

Azuma Hazuki

Golden Member
Jun 18, 2012
1,532
866
131
FMA - Fused Multiply-Add. A single-instruction multiply-add, which saves much heat and processor time.

AVX2- Advanced Vector eXtensions, ver. 2. Something like SIMD (SSE) for integer operations; massively speeds up integer computation where supported, as the first AVX did for floating-point operations.
 

NTMBK

Lifer
Nov 14, 2011
10,355
5,446
136
And to make that a little clearer... ;)

SIMD - single instruction, multiple data. This lets the processor do sums on multiple numbers at once, instead of just one. SSE lets it operate on 4 numbers at once, and AVX lets it operate on 8 numbers at once. (AVX2 adds support for integers, whereas AVX1 was just floating point [decimal numbers]).

FMA - this lets the processor work out A = (B*C)+D all in one calculation, instead of doing the multiply and the addition separately.
 

Idontcare

Elite Member
Oct 10, 1999
21,110
59
91
This is a great question, and a great thread!

Thanks OP for posting the question, and thanks contributors for taking time to respond :) Good stuff all around :thumbsup:
 

Pilum

Member
Aug 27, 2012
182
3
81
SIMD - single instruction, multiple data. This lets the processor do sums on multiple numbers at once, instead of just one. SSE lets it operate on 4 numbers at once, and AVX lets it operate on 8 numbers at once. (AVX2 adds support for integers, whereas AVX1 was just floating point [decimal numbers]).
To enhance on AVX2: when you can get away with 16-bit or 8-bit integer calculations (image&video processing), AVX2 can work on 16 or 32 elements at once.

E.g. for image scaling you can usually use 16-bit integers with fixed-point math instead of floating point. With the two AVX pipelines Haswell can do 32 16-bit operations per core per cycle, that is 128 ops/cycle for a 4-core HSW. In contrast, GPUs can't split their FP execution units like that, if you work with 16-bit integers, you basically waste half of the processing power. This will make Haswell rather strong compared to GPGPU for appropriate workloads, once the software has been adopted. And of course porting from SSE2+ to AVX2 is rather easy, as you basically only need to adopt the code to the wider instructions and change the pointer adjustments; this is much easier than designing and writing whole new OpenCL/CUDA routines.
 

Phynaz

Lifer
Mar 13, 2006
10,140
819
126
To make it a little more clear:

AVX2 is the (marketing) name given to a set of software instructions added to Haswell processors that do what other posters have pointed out.
 

Greenlepricon

Senior member
Aug 1, 2012
468
0
0
Thanks everyone! Maybe we should just make a thread for all of these crazy acronyms that I don't understand.
 

SocketF

Senior member
Jun 2, 2006
236
0
71
AVX2 gets released with Haswell and extends the avx with to 256 bit
No, AVX can handle 256bit already, what AVX2 does is delivering more INT instructions (and some other weired ones (gather/scatter). AVX so far had only FP-instructions.

In other words: AVX2 is a bit more than AMD's XOP-instructions (which were limited to 128bit).

AMD planned SSE5 long ago with INT&FP SIMD 3operand-instructions plus FMA instructions from the start. Intel than added 256bit support, invented the VEX-prefix used only FP and named it AVX.

Because AVX is only a SSE5 subset but with 256bit, AMD used it, too, and the leftovers of SSE5 (the INT instructions) were called XOP.

Now with AVX2 you get INT 3op-operations, too. Haswell also has FMA, but that extension has its own CPUID-flag, i.e. it shouldnt be counted as AVX2.

For example, one of the next VIA CPUs (yes they are still alive) will support AVX2, but not FMA.