ia32-64/x86/pshufb.html
2025-07-08 02:23:29 -03:00

300 lines
22 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:x86="http://www.felixcloutier.com/x86"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="style.css"></link><title>PSHUFB
— Packed Shuffle Bytes</title></head><body><header><nav><ul><li><a href='index.html'>Index</a></li><li>December 2023</li></ul></nav></header><h1>PSHUFB
— Packed Shuffle Bytes</h1>
<table>
<tr>
<th>Opcode/Instruction</th>
<th>Op/En</th>
<th>64/32 bit Mode Support</th>
<th>CPUID Feature Flag</th>
<th>Description</th></tr>
<tr>
<td>NP 0F 38 00 /r<sup>1</sup> PSHUFB mm1, mm2/m64</td>
<td>A</td>
<td>V/V</td>
<td>SSSE3</td>
<td>Shuffle bytes in mm1 according to contents of mm2/m64.</td></tr>
<tr>
<td>66 0F 38 00 /r PSHUFB xmm1, xmm2/m128</td>
<td>A</td>
<td>V/V</td>
<td>SSSE3</td>
<td>Shuffle bytes in xmm1 according to contents of xmm2/m128.</td></tr>
<tr>
<td>VEX.128.66.0F38.WIG 00 /r VPSHUFB xmm1, xmm2, xmm3/m128</td>
<td>B</td>
<td>V/V</td>
<td>AVX</td>
<td>Shuffle bytes in xmm2 according to contents of xmm3/m128.</td></tr>
<tr>
<td>VEX.256.66.0F38.WIG 00 /r VPSHUFB ymm1, ymm2, ymm3/m256</td>
<td>B</td>
<td>V/V</td>
<td>AVX2</td>
<td>Shuffle bytes in ymm2 according to contents of ymm3/m256.</td></tr>
<tr>
<td>EVEX.128.66.0F38.WIG 00 /r VPSHUFB xmm1 {k1}{z}, xmm2, xmm3/m128</td>
<td>C</td>
<td>V/V</td>
<td>AVX512VL AVX512BW</td>
<td>Shuffle bytes in xmm2 according to contents of xmm3/m128 under write mask k1.</td></tr>
<tr>
<td>EVEX.256.66.0F38.WIG 00 /r VPSHUFB ymm1 {k1}{z}, ymm2, ymm3/m256</td>
<td>C</td>
<td>V/V</td>
<td>AVX512VL AVX512BW</td>
<td>Shuffle bytes in ymm2 according to contents of ymm3/m256 under write mask k1.</td></tr>
<tr>
<td>EVEX.512.66.0F38.WIG 00 /r VPSHUFB zmm1 {k1}{z}, zmm2, zmm3/m512</td>
<td>C</td>
<td>V/V</td>
<td>AVX512BW</td>
<td>Shuffle bytes in zmm2 according to contents of zmm3/m512 under write mask k1.</td></tr></table>
<blockquote>
<p>1. See note in Section 2.5, “Intel® AVX and Intel® SSE Instruction Exception Classification,” in the Intel<sup>®</sup> 64 and IA-32 Architectures Software Developers Manual, Volume 2A, and Section 23.25.3, “Exception Conditions of Legacy SIMD Instructions Operating on MMX Registers,” in the Intel<sup>®</sup> 64 and IA-32 Architectures Software Developers Manual, Volume 3B.</p></blockquote>
<h2 id="instruction-operand-encoding">Instruction Operand Encoding<a class="anchor" href="#instruction-operand-encoding">
</a></h2>
<table>
<tr>
<th>Op/En</th>
<th>Tuple Type</th>
<th>Operand 1</th>
<th>Operand 2</th>
<th>Operand 3</th>
<th>Operand 4</th></tr>
<tr>
<td>A</td>
<td>N/A</td>
<td>ModRM:reg (r, w)</td>
<td>ModRM:r/m (r)</td>
<td>N/A</td>
<td>N/A</td></tr>
<tr>
<td>B</td>
<td>N/A</td>
<td>ModRM:reg (w)</td>
<td>VEX.vvvv (r)</td>
<td>ModRM:r/m (r)</td>
<td>N/A</td></tr>
<tr>
<td>C</td>
<td>Full Mem</td>
<td>ModRM:reg (w)</td>
<td>EVEX.vvvv (r)</td>
<td>ModRM:r/m (r)</td>
<td>N/A</td></tr></table>
<h2 id="description">Description<a class="anchor" href="#description">
</a></h2>
<p>PSHUFB performs in-place shuffles of bytes in the destination operand (the first operand) according to the shuffle control mask in the source operand (the second operand). The instruction permutes the data in the destination operand, leaving the shuffle mask unaffected. If the most significant bit (bit[7]) of each byte of the shuffle control mask is set, then constant zero is written in the result byte. Each byte in the shuffle control mask forms an index to permute the corresponding byte in the destination operand. The value of each index is the least significant 4 bits (128-bit operation) or 3 bits (64-bit operation) of the shuffle control byte. When the source operand is a 128-bit memory operand, the operand must be aligned on a 16-byte boundary or a general-protection exception (#GP) will be generated.</p>
<p>In 64-bit mode and not encoded with VEX/EVEX, use the REX prefix to access XMM8-XMM15 registers.</p>
<p>Legacy SSE version 64-bit operand: Both operands can be MMX registers.</p>
<p>128-bit Legacy SSE version: The first source operand and the destination operand are the same. Bits (MAXVL-1:128) of the corresponding YMM destination register remain unchanged.</p>
<p>VEX.128 encoded version: The destination operand is the first operand, the first source operand is the second operand, the second source operand is the third operand. Bits (MAXVL-1:128) of the destination YMM register are zeroed.</p>
<p>VEX.256 encoded version: Bits (255:128) of the destination YMM register stores the 16-byte shuffle result of the upper 16 bytes of the first source operand, using the upper 16-bytes of the second source operand as control mask.</p>
<p>The value of each index is for the high 128-bit lane is the least significant 4 bits of the respective shuffle control byte. The index value selects a source data element within each 128-bit lane.</p>
<p>EVEX encoded version: The second source operand is an ZMM/YMM/XMM register or an 512/256/128-bit memory location. The first source operand and destination operands are ZMM/YMM/XMM registers. The destination is conditionally updated with writemask k1.</p>
<p>EVEX and VEX encoded version: Four/two in-lane 128-bit shuffles.</p>
<h2 id="operation">Operation<a class="anchor" href="#operation">
</a></h2>
<h3 id="pshufb--with-64-bit-operands-">PSHUFB (With 64-bit Operands)<a class="anchor" href="#pshufb--with-64-bit-operands-">
</a></h3>
<pre>TEMP := DEST
for i = 0 to 7 {
if (SRC[(i * 8)+7] = 1 ) then
DEST[(i*8)+7...(i*8)+0] := 0;
else
index[2..0] := SRC[(i*8)+2 .. (i*8)+0];
DEST[(i*8)+7...(i*8)+0] := TEMP[(index*8+7)..(index*8+0)];
endif;
}
PSHUFB (with 128 bit operands)
TEMP := DEST
for i = 0 to 15 {
if (SRC[(i * 8)+7] = 1 ) then
DEST[(i*8)+7..(i*8)+0] := 0;
else
index[3..0] := SRC[(i*8)+3 .. (i*8)+0];
DEST[(i*8)+7..(i*8)+0] := TEMP[(index*8+7)..(index*8+0)];
endif
}
</pre>
<h3 id="vpshufb--vex-128-encoded-version-">VPSHUFB (VEX.128 Encoded Version)<a class="anchor" href="#vpshufb--vex-128-encoded-version-">
</a></h3>
<pre>for i = 0 to 15 {
if (SRC2[(i * 8)+7] = 1) then
DEST[(i*8)+7..(i*8)+0] := 0;
else
index[3..0] := SRC2[(i*8)+3 .. (i*8)+0];
DEST[(i*8)+7..(i*8)+0] := SRC1[(index*8+7)..(index*8+0)];
endif
}
DEST[MAXVL-1:128] := 0
</pre>
<h3 id="vpshufb--vex-256-encoded-version-">VPSHUFB (VEX.256 Encoded Version)<a class="anchor" href="#vpshufb--vex-256-encoded-version-">
</a></h3>
<pre>for i = 0 to 15 {
if (SRC2[(i * 8)+7] == 1 ) then
DEST[(i*8)+7..(i*8)+0] := 0;
else
index[3..0] := SRC2[(i*8)+3 .. (i*8)+0];
DEST[(i*8)+7..(i*8)+0] := SRC1[(index*8+7)..(index*8+0)];
endif
if (SRC2[128 + (i * 8)+7] == 1 ) then
DEST[128 + (i*8)+7..(i*8)+0] := 0;
else
index[3..0] := SRC2[128 + (i*8)+3 .. (i*8)+0];
DEST[128 + (i*8)+7..(i*8)+0] := SRC1[128 + (index*8+7)..(index*8+0)];
endif
}
</pre>
<h3 id="vpshufb--evex-encoded-versions-">VPSHUFB (EVEX Encoded Versions)<a class="anchor" href="#vpshufb--evex-encoded-versions-">
</a></h3>
<pre>(KL, VL) = (16, 128), (32, 256), (64, 512)
jmask := (KL-1) &amp; ~0xF
// 0x00, 0x10, 0x30 depending on the VL
FOR j = 0 TO KL-1
// dest
IF kl[ i ] or no_masking
index := src.byte[ j ];
IF index &amp; 0x80
Dest.byte[ j ] := 0;
ELSE
index := (index &amp; 0xF) + (j &amp; jmask);
// 16-element in-lane lookup
Dest.byte[ j ] := src.byte[ index ];
ELSE if zeroing
Dest.byte[ j ] := 0;
DEST[MAXVL-1:VL] := 0;
</pre>
<figure id="fig-4-15">
<svg style="width: 460.512pt; height: 202.896012pt" viewBox="107.06 0.0 388.76 174.08001000000002">
<g xmlns="http://www.w3.org/2000/svg" style="fill: none; stroke: none">
<rect height="168.12" style="fill: rgb(0%, 0%, 0%)" width="0.48" x="109.56" y="0.48000999999999294"></rect>
<rect height="168.12" style="fill: rgb(0%, 0%, 0%)" width="0.47998" x="492.84000000000003" y="0.48000999999999294"></rect>
<rect height="0.48001000000000005" style="fill: rgb(0%, 0%, 0%)" width="383.76" x="109.56" y="0.0"></rect>
<rect height="0.48001000000000005" style="fill: rgb(0%, 0%, 0%)" width="383.76" x="109.56" y="168.60000000000002"></rect>
<path d="M 481.372 31.46401000000003 L 118.531 31.46401000000003" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.372 56.40901000000002 L 118.531 56.40901000000002" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 209.238 31.465010000000007 L 209.238 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 163.88299999999998 31.465010000000007 L 163.88299999999998 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.371 31.465010000000007 L 481.371 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 436.015 31.465010000000007 L 436.015 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 254.594 31.465010000000007 L 254.594 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 299.95 31.465010000000007 L 299.95 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 345.305 31.465010000000007 L 345.305 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 390.661 31.465010000000007 L 390.661 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 118.529 31.465010000000007 L 118.529 56.41001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.374 71.15001000000001 L 118.53300000000002 71.15001000000001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.374 96.09501 L 118.53300000000002 96.09501" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 209.24 71.15100999999999 L 209.24 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 163.885 71.15100999999999 L 163.885 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.373 71.15100999999999 L 481.373 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 436.017 71.15100999999999 L 436.017 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 254.596 71.15100999999999 L 254.596 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 299.952 71.15100999999999 L 299.952 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 345.307 71.15100999999999 L 345.307 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 390.663 71.15100999999999 L 390.663 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 118.531 71.15100999999999 L 118.531 96.09600999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.37600000000003 124.44200999999998 L 118.53500000000003 124.44200999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.37600000000003 149.38801 L 118.53500000000003 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 209.24200000000002 124.44301000000002 L 209.24200000000002 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 163.887 124.44301000000002 L 163.887 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.375 124.44301000000002 L 481.375 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 436.019 124.44301000000002 L 436.019 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 254.598 124.44301000000002 L 254.598 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 299.954 124.44301000000002 L 299.954 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 345.309 124.44301000000002 L 345.309 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 390.665 124.44301000000002 L 390.665 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 118.53300000000002 124.44301000000002 L 118.53300000000002 149.38801" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 413.339 96.09401000000003 L 335.647 121.65001000000001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 336.57800000000003 124.47701 L 327.16700000000003 124.43901 L 334.718 118.82201000000003 L 336.57800000000003 124.47701" style="fill: rgb(0%, 0%, 0%); fill-rule: evenodd"></path>
<path d="M 431.315 118.90901000000002 L 431.539 118.72501 L 458.692 96.10001 L 374.786 124.44501000000002" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 433.427 121.02600999999999 L 424.639 124.39301 L 429.648 116.42701 L 433.427 121.02600999999999" style="fill: rgb(0%, 0%, 0%); fill-rule: evenodd"></path>
<path d="M 458.695 124.44400999999999 L 457.413 97.16901000000001" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 404.169 114.51701000000003 L 385.115 120.95401000000004" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 386.068 123.77401000000003 L 376.657 123.81201000000004 L 384.162 118.13501000000002 L 386.068 123.77401000000003" style="fill: rgb(0%, 0%, 0%); fill-rule: evenodd"></path>
<path d="M 458.053 110.84101000000004 L 458.45 121.62501000000003" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 460.656 121.54401000000001 L 458.692 128.24501000000004 L 456.242 121.70600999999999 L 460.656 121.54401000000001" style="fill: rgb(0%, 0%, 0%); fill-rule: evenodd"></path>
<path d="M 182.023 124.44501000000002 L 141.206 96.10001 L 141.206 115.51701000000003" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 144.18200000000002 115.51701000000003 L 141.20600000000002 124.44501000000002 L 138.23000000000002 115.51701000000003 L 144.18200000000002 115.51701000000003" style="fill: rgb(0%, 0%, 0%); fill-rule: evenodd"></path>
<path d="M 169.093 115.46601000000004 L 178.584 121.07301000000007" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 179.708 119.17301000000003 L 184.288 124.44401000000005 L 177.462 122.97501000000005 L 179.708 119.17301000000003" style="fill: rgb(0%, 0%, 0%); fill-rule: evenodd"></path>
<path d="M 118.528 159.59501 L 121.92800000000001 159.59501" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 120.736 157.38701000000003 L 118.528 159.59501000000006 L 120.736 161.80301000000003" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 481.372 161.86101000000002 L 478.54 161.86101000000002" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 479.164 164.06901 L 481.372 161.86100999999996 L 479.164 159.65301" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 118.528 23.529010000000028 L 121.92800000000001 23.529010000000028" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<path d="M 120.736 21.32101 L 118.528 23.529010000000028 L 120.736 25.737009999999998" style="fill-rule: nonzero; stroke: rgb(0%, 0%, 0%)"></path>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="17.776444400000003" x="268.3832" y="27.60905200000002">MM2</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="139.87210000000002" y="45.852652000000035">07H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="174.56096720000014" y="45.852652000000035">07H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="15.552388799999989" x="220.37011240000032" y="45.852652000000035">FFH</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="269.28333520000035" y="45.852652000000035">80H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="317.3165360000002" y="45.852652000000035">01H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="356.45351440000013" y="45.852652000000035">00H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="404.4867152" y="45.852652000000035">00H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="445.8477491999999" y="45.852652000000035">00H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="17.776444400000003" x="268.3832" y="68.0260624">MM1</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="139.87210000000002" y="86.57367000000005">04H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="174.56096720000014" y="86.57367000000005">01H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="220.37011240000032" y="86.57367000000005">07H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="268.40331320000035" y="86.57367000000005">03H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="316.4365140000002" y="86.57367000000005">02H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="355.57349240000013" y="86.57367000000005">02H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="15.552388800000017" x="403.6066932" y="86.57367000000005">FFH</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="445.84774919999984" y="86.57367000000005">01H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="17.776444400000003" x="267.59918039999997" y="123.25944320000002">MM1</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="142.13615660000002" y="138.73497400000002">04H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="176.82502380000014" y="138.73497400000002">04H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366799999992" x="222.63416900000033" y="138.73497400000002">00H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="270.66736980000036" y="138.73497400000002">00H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="15.552388800000017" x="318.7005706000002" y="138.73497400000002">FFH</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="358.7175710000001" y="138.73497400000002">01H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="406.75077179999994" y="138.73497400000002">01H</text>
<text lengthAdjust="spacingAndGlyphs" style="font-size: 7.408185199999991pt; fill: #000" textLength="14.672366800000077" x="448.11180579999984" y="138.73497400000002">01H</text></g></svg>
<figcaption><a href='pshufb.html#fig-4-15'>Figure 4-15</a>. PSHUFB with 64-Bit Operands</figcaption></figure>
<h2 id="intel-c-c++-compiler-intrinsic-equivalent">Intel C/C++ Compiler Intrinsic Equivalent<a class="anchor" href="#intel-c-c++-compiler-intrinsic-equivalent">
</a></h2>
<pre>VPSHUFB __m512i _mm512_shuffle_epi8(__m512i a, __m512i b);
</pre>
<pre>VPSHUFB __m512i _mm512_mask_shuffle_epi8(__m512i s, __mmask64 k, __m512i a, __m512i b);
</pre>
<pre>VPSHUFB __m512i _mm512_maskz_shuffle_epi8( __mmask64 k, __m512i a, __m512i b);
</pre>
<pre>VPSHUFB __m256i _mm256_mask_shuffle_epi8(__m256i s, __mmask32 k, __m256i a, __m256i b);
</pre>
<pre>VPSHUFB __m256i _mm256_maskz_shuffle_epi8( __mmask32 k, __m256i a, __m256i b);
</pre>
<pre>VPSHUFB __m128i _mm_mask_shuffle_epi8(__m128i s, __mmask16 k, __m128i a, __m128i b);
</pre>
<pre>VPSHUFB __m128i _mm_maskz_shuffle_epi8( __mmask16 k, __m128i a, __m128i b);
</pre>
<pre>PSHUFB: __m64 _mm_shuffle_pi8 (__m64 a, __m64 b)
</pre>
<pre>(V)PSHUFB: __m128i _mm_shuffle_epi8 (__m128i a, __m128i b)
</pre>
<pre>VPSHUFB:__m256i _mm256_shuffle_epi8(__m256i a, __m256i b)
</pre>
<h2 class="exceptions" id="simd-floating-point-exceptions">SIMD Floating-Point Exceptions<a class="anchor" href="#simd-floating-point-exceptions">
</a></h2>
<p>None.</p>
<h2 class="exceptions" id="other-exceptions">Other Exceptions<a class="anchor" href="#other-exceptions">
</a></h2>
<p>Non-EVEX-encoded instruction, see <span class="not-imported">Table 2-21</span>, “Type 4 Class Exception Conditions.”</p>
<p>EVEX-encoded instruction, see Exceptions Type E4NF.nb in <span class="not-imported">Table 2-50</span>, “Type E4NF Class Exception Conditions.”</p><footer><p>
This UNOFFICIAL, mechanically-separated, non-verified reference is provided for convenience, but it may be
inc<span style="opacity: 0.2">omp</span>lete or b<sub>r</sub>oke<sub>n</sub> in various obvious or non-obvious
ways. Refer to <a href="https://software.intel.com/en-us/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4">Intel® 64 and IA-32 Architectures Software Developers Manual</a> for anything serious.
</p></footer></body></html>