For each element, performs MUL and ADD/SUB calculation with 3 operands and store the result in the first operand. (returns the result.)
Which operands to MUL, and which operand to ADD/SUB, depend on the order of the numbers (1, 2, 3) in the instruction name. depend on the order of arguments for intrinsic.
????? | instruction name | odd | even |
---|---|---|---|
FMADD | VFMADD132PH | (1) * (3) + (2) | |
VFMADD213PH | (2) * (1) + (3) | ||
VFMADD231PH | (2) * (3) + (1) | ||
_mm_fmadd_ph _mm256_fmadd_ph _mm512_fmadd_ph |
a * b + c | ||
FMSUB | VFMSUB132PH | (1) * (3) - (2) | |
VFMSUB213PH | (2) * (1) - (3) | ||
VFMSUB231PH | (2) * (3) - (1) | ||
_mm_fmsub_ph _mm256_fmsub_ph _mm512_fmsub_ph |
a * b - c | ||
FMADDSUB | VFMADDSUB132PH | (1) * (3) + (2) | (1) * (3) - (2) |
VFMADDSUB213PH | (2) * (1) + (3) | (2) * (1) - (3) | |
VFMADDSUB231PH | (2) * (3) + (1) | (2) * (3) - (1) | |
_mm_fmaddsub_ph _mm256_fmaddsub_ph _mm512_fmaddsub_ph |
a * b + c | a * b - c | |
FMSUBADD | VFMSUBADD132PH | (1) * (3) - (2) | (1) * (3) + (2) |
VFMSUBADD213PH | (2) * (1) - (3) | (2) * (1) + (3) | |
VFMSUBADD231PH | (2) * (3) - (1) | (2) * (3) + (1) | |
_mm_fmsubadd_ph _mm256_fmsubadd_ph _mm512_fmsubadd_ph |
a * b - c | a * b + c | |
FNMADD | VFNMADD132PH | - (1) * (3) + (2) | |
VFNMADD213PH | - (2) * (1) + (3) | ||
VFNMADD231PH | - (2) * (3) + (1) | ||
_mm_fnmadd_ph _mm256_fnmadd_ph _mm512_fnmadd_ph |
- a * b + c | ||
FNMSUB | VFNMSUB132PH | - (1) * (3) - (2) | |
VFNMSUB213PH | - (2) * (1) - (3) | ||
VFNMSUB231PH | - (2) * (3) - (1) | ||
_mm_fnmsub_ph _mm256_fnmsub_ph _mm512_fnmsub_ph |
- a * b - c |
_mask_ if k bit is 0, a is copied.
_mask3_ if k bit is 0, c is copied.
_maskz_ if k bit is 0, zero cleared.