Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

_mm256_madd_epi16

Multiplies signed packed 16-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPMADDW.

Syntax

extern __m256i _mm256_madd_epi16(__m256i s1, __m256i s2);

Arguments

s1

integer source vector used for the operation

s2

integer source vector used for the operation

Description

Multiplies individual, signed 16-bit integers of source vector s1 by the corresponding signed 16-bit integers of source vector s2, producing temporary, signed, 32-bit [doubleword] results. The adjacent doubleword results are then summed and stored in the destination vector.

For example, the corresponding low-order words (15:0) and (31-16) in s2 and s1 vectors are multiplied, and the doubleword results are added together and stored in the low doubleword of the destination vector (31-0). The same operation is performed on the other pairs of adjacent words.

Returns

Result of the multiplication operation.