03.03.2013 Views

Intel® Architecture Instruction Set Extensions Programming Reference

Intel® Architecture Instruction Set Extensions Programming Reference

Intel® Architecture Instruction Set Extensions Programming Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INSTRUCTION SET REFERENCE - FMA<br />

the infinite precision intermediate result, subtracts the odd single-precision floating-point elements and adds the<br />

even single-precision floating-point values in the first source operand, performs rounding and stores the resulting<br />

four or eight packed single-precision floating-point values to the destination operand (first source operand).<br />

VEX.256 encoded version: The destination operand (also first source operand) is a YMM register and encoded in<br />

reg_field. The second source operand is a YMM register and encoded in VEX.vvvv. The third source operand is a<br />

YMM register or a 256-bit memory location and encoded in rm_field.<br />

VEX.128 encoded version: The destination operand (also first source operand) is a XMM register and encoded in<br />

reg_field. The second source operand is a XMM register and encoded in VEX.vvvv. The third source operand is a<br />

XMM register or a 128-bit memory location and encoded in rm_field. The upper 128 bits of the YMM destination<br />

register are zeroed.<br />

Compiler tools may optionally support a complementary mnemonic for each instruction mnemonic listed in the<br />

opcode/instruction column of the summary table. The behavior of the complementary mnemonic in situations<br />

involving NANs are governed by the definition of the instruction mnemonic defined in the opcode/instruction<br />

column. See also Section 2.3.1, “FMA <strong>Instruction</strong> Operand Order and Arithmetic Behavior”.<br />

Operation<br />

In the operations below, "+", "-", and "*" symbols represent addition, subtraction, and multiplication operations<br />

with infinite precision inputs and outputs (no rounding).<br />

VFMSUBADD132PS DEST, SRC2, SRC3<br />

IF (VEX.128) THEN<br />

MAXVL =2<br />

ELSEIF (VEX.256)<br />

MAXVL = 4<br />

FI<br />

For i = 0 to MAXVL -1{<br />

n = 64*i;<br />

DEST[n+31:n] RoundFPControl_MXCSR(DEST[n+31:n]*SRC3[n+31:n] + SRC2[n+31:n])<br />

DEST[n+63:n+32] RoundFPControl_MXCSR(DEST[n+63:n+32]*SRC3[n+63:n+32] -SRC2[n+63:n+32])<br />

}<br />

IF (VEX.128) THEN<br />

DEST[VLMAX-1:128] 0<br />

FI<br />

VFMSUBADD213PS DEST, SRC2, SRC3<br />

IF (VEX.128) THEN<br />

MAXVL =2<br />

ELSEIF (VEX.256)<br />

MAXVL = 4<br />

FI<br />

For i = 0 to MAXVL -1{<br />

n = 64*i;<br />

DEST[n+31:n] RoundFPControl_MXCSR(SRC2[n+31:n]*DEST[n+31:n] +SRC3[n+31:n])<br />

DEST[n+63:n+32] RoundFPControl_MXCSR(SRC2[n+63:n+32]*DEST[n+63:n+32] -SRC3[n+63:n+32])<br />

}<br />

IF (VEX.128) THEN<br />

DEST[VLMAX-1:128] 0<br />

FI<br />

VFMSUBADD231PS DEST, SRC2, SRC3<br />

IF (VEX.128) THEN<br />

MAXVL =2<br />

ELSEIF (VEX.256)<br />

MAXVL = 4<br />

6-22 Ref. # 319433-014

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!