108 lines
5.4 KiB
HTML
108 lines
5.4 KiB
HTML
<!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>PCMPISTRI
|
||
— Packed Compare Implicit Length Strings, Return Index</title></head><body><header><nav><ul><li><a href='index.html'>Index</a></li><li>December 2023</li></ul></nav></header><h1>PCMPISTRI
|
||
— Packed Compare Implicit Length Strings, Return Index</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>66 0F 3A 63 /r imm8 PCMPISTRI xmm1, xmm2/m128, imm8</td>
|
||
<td>RM</td>
|
||
<td>V/V</td>
|
||
<td>SSE4_2</td>
|
||
<td>Perform a packed comparison of string data with implicit lengths, generating an index, and storing the result in ECX.</td></tr>
|
||
<tr>
|
||
<td>VEX.128.66.0F3A.WIG 63 /r ib VPCMPISTRI xmm1, xmm2/m128, imm8</td>
|
||
<td>RM</td>
|
||
<td>V/V</td>
|
||
<td>AVX</td>
|
||
<td>Perform a packed comparison of string data with implicit lengths, generating an index, and storing the result in ECX.</td></tr></table>
|
||
<h2 id="instruction-operand-encoding">Instruction Operand Encoding<a class="anchor" href="#instruction-operand-encoding">
|
||
¶
|
||
</a></h2>
|
||
<table>
|
||
<tr>
|
||
<th>Op/En</th>
|
||
<th>Operand 1</th>
|
||
<th>Operand 2</th>
|
||
<th>Operand 3</th>
|
||
<th>Operand 4</th></tr>
|
||
<tr>
|
||
<td>RM</td>
|
||
<td>ModRM:reg (r)</td>
|
||
<td>ModRM:r/m (r)</td>
|
||
<td>imm8</td>
|
||
<td>N/A</td></tr></table>
|
||
<h2 id="description">Description<a class="anchor" href="#description">
|
||
¶
|
||
</a></h2>
|
||
<p>The instruction compares data from two strings based on the encoded value in the imm8 control byte (see Section 4.1, “Imm8 Control Byte Operation for PCMPESTRI / PCMPESTRM / PCMPISTRI / PCMPISTRM”), and generates an index stored to ECX.</p>
|
||
<p>Each string is represented by a single value. The value is an xmm (or possibly m128 for the second operand) which contains the data elements of the string (byte or word data). Each input byte/word is augmented with a valid/invalid tag. A byte/word is considered valid only if it has a lower index than the least significant null byte/word. (The least significant null byte/word is also considered invalid.)</p>
|
||
<p>The comparison and aggregation operations are performed according to the encoded value of imm8 bit fields (see Section 4.1). The index of the first (or last, according to imm8[6]) set bit of IntRes2 is returned in ECX. If no bits are set in IntRes2, ECX is set to 16 (8).</p>
|
||
<p>Note that the Arithmetic Flags are written in a non-standard manner in order to supply the most relevant information:</p>
|
||
<p>CFlag – Reset if IntRes2 is equal to zero, set otherwise</p>
|
||
<p>ZFlag – Set if any byte/word of xmm2/mem128 is null, reset otherwise</p>
|
||
<p>SFlag – Set if any byte/word of xmm1 is null, reset otherwise</p>
|
||
<p>OFlag –IntRes2[0]</p>
|
||
<p>AFlag – Reset</p>
|
||
<p>PFlag – Reset</p>
|
||
<p>Note: In VEX.128 encoded version, VEX.vvvv is reserved and must be 1111b, VEX.L must be 0, otherwise the instruction will #UD.</p>
|
||
<h2 id="effective-operand-size">Effective Operand Size<a class="anchor" href="#effective-operand-size">
|
||
¶
|
||
</a></h2>
|
||
<table>
|
||
<tr>
|
||
<th>Operating mode/size</th>
|
||
<th>Operand 1</th>
|
||
<th>Operand 2</th>
|
||
<th>Result</th></tr>
|
||
<tr>
|
||
<td>16 bit</td>
|
||
<td>xmm</td>
|
||
<td>xmm/m128</td>
|
||
<td>ECX</td></tr>
|
||
<tr>
|
||
<td>32 bit</td>
|
||
<td>xmm</td>
|
||
<td>xmm/m128</td>
|
||
<td>ECX</td></tr>
|
||
<tr>
|
||
<td>64 bit</td>
|
||
<td>xmm</td>
|
||
<td>xmm/m128</td>
|
||
<td>ECX</td></tr></table>
|
||
<h2 id="intel-c-c++-compiler-intrinsic-equivalent-for-returning-index">Intel C/C++ Compiler Intrinsic Equivalent For Returning Index<a class="anchor" href="#intel-c-c++-compiler-intrinsic-equivalent-for-returning-index">
|
||
¶
|
||
</a></h2>
|
||
<p>int _mm_cmpistri (__m128i a, __m128i b, const int mode);</p>
|
||
<h2 id="intel-c-c++-compiler-intrinsics-for-reading-eflag-results">Intel C/C++ Compiler Intrinsics For Reading EFlag Results<a class="anchor" href="#intel-c-c++-compiler-intrinsics-for-reading-eflag-results">
|
||
¶
|
||
</a></h2>
|
||
<p>int _mm_cmpistra (__m128i a, __m128i b, const int mode);</p>
|
||
<p>int _mm_cmpistrc (__m128i a, __m128i b, const int mode);</p>
|
||
<p>int _mm_cmpistro (__m128i a, __m128i b, const int mode);</p>
|
||
<p>int _mm_cmpistrs (__m128i a, __m128i b, const int mode);</p>
|
||
<p>int _mm_cmpistrz (__m128i a, __m128i b, const int mode);</p>
|
||
<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>See <span class="not-imported">Table 2-21</span>, “Type 4 Class Exception Conditions,” additionally, this instruction does not cause #GP if the memory operand is not aligned to 16 Byte boundary, and:</p>
|
||
<table>
|
||
<tr>
|
||
<td rowspan="2">#UD</td>
|
||
<td>If VEX.L = 1.</td></tr>
|
||
<tr>
|
||
<td>If VEX.vvvv ≠ 1111B.</td></tr></table><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 Developer’s Manual</a> for anything serious.
|
||
</p></footer></body></html>
|