Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

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

Document Table of Contents

<span class='option'>_mm256_maddubs_epi16 </span>

Multiplies unsigned packed 16-bit integer data elements of one vector with signed elements of second vector. The corresponding Intel® AVX2 instruction is VPMADDUBSW.

Syntax

extern __m256i _mm256_maddubs_epi16(__m256i s1, __m256i s2);

Arguments

s1

integer source vector used for the operation

s2

integer source vector used for the operation

Description

Multiplies vertically each unsigned byte of source vector s1 with the corresponding signed byte of source vector s2, producing intermediate, signed 16-bit integers. Each adjacent pair of signed words is added, and the saturated result is packed to the destination vector.

For example, the lowest-order bytes (bits 7:0) in s1 and s2 vectors are multiplied and the intermediate signed word result is added with the corresponding intermediate result from the 2nd lowest-order bytes (bits 15:8) of the vectors. The sign-saturated result is stored in the lowest word of the destination vector (15:0). The same operation is performed on the other pairs of adjacent bytes.

Returns

Result of the multiplication operation.