| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <meta charset="UTF-8"> |
| <link href="style.css" type="text/css" rel="stylesheet"> |
| <title>MULX — Unsigned Multiply Without Affecting Flags </title></head> |
| <body> |
| <h1>MULX — Unsigned Multiply Without Affecting Flags</h1> |
| <table> |
| <tr> |
| <th>Opcode/Instruction</th> |
| <th>Op/En</th> |
| <th>64/32 -bit Mode</th> |
| <th>CPUID Feature Flag</th> |
| <th>Description</th></tr> |
| <tr> |
| <td> |
| <p>VEX.NDD.LZ.F2.0F38.W0 F6 /r</p> |
| <p>MULX <em>r32a, r32b, r/m32</em></p></td> |
| <td>RVM</td> |
| <td>V/V</td> |
| <td>BMI2</td> |
| <td>Unsigned multiply of <em>r/m32</em> with EDX without affecting arithmetic flags.</td></tr> |
| <tr> |
| <td> |
| <p>VEX.NDD.LZ.F2.0F38.W1 F6 /r</p> |
| <p>MULX <em>r64a, r64b, r/m64</em></p></td> |
| <td>RVM</td> |
| <td>V/N.E.</td> |
| <td>BMI2</td> |
| <td>Unsigned multiply of <em>r/m64</em> with RDX without affecting arithmetic flags.</td></tr></table> |
| <h3>Instruction Operand Encoding</h3> |
| <table> |
| <tr> |
| <td> |
| <p>Op/En</p> |
| <p>RVM</p></td> |
| <td> |
| <p>Operand 1</p> |
| <p>ModRM:reg (w)</p></td> |
| <td> |
| <p>Operand 2</p> |
| <p>VEX.vvvv (w)</p></td> |
| <td> |
| <p>Operand 3</p> |
| <p>ModRM:r/m (r)</p></td> |
| <td> |
| <p>Operand 4</p> |
| <p>RDX/EDX is implied 64/32 bits</p> |
| <p>source</p></td></tr></table> |
| <h2>Description</h2> |
| <p>Performs an unsigned multiplication of the implicit source operand (EDX/RDX) and the specified source operand (the third operand) and stores the low half of the result in the second destination (second operand), the high half of the result in the first destination operand (first operand), without reading or writing the arithmetic flags. This enables efficient programming where the software can interleave add with carry operations and multiplications.</p> |
| <p>If the first and second operand are identical, it will contain the high half of the multiplication result.</p> |
| <p>This instruction is not supported in real mode and virtual-8086 mode. The operand size is always 32 bits if not in 64-bit mode. In 64-bit mode operand size 64 requires VEX.W1. VEX.W1 is ignored in non-64-bit modes. An attempt to execute this instruction with VEX.L not equal to 0 will cause #UD.</p> |
| <h2>Operation</h2> |
| <pre>// DEST1: ModRM:reg |
| // DEST2: VEX.vvvv |
| IF (OperandSize = 32) |
| SRC1 ← EDX; |
| DEST2 ← (SRC1*SRC2)[31:0]; |
| DEST1 ← (SRC1*SRC2)[63:32]; |
| ELSE IF (OperandSize = 64) |
| SRC1 ← RDX; |
| DEST2 ← (SRC1*SRC2)[63:0]; |
| DEST1 ← (SRC1*SRC2)[127:64]; |
| FI</pre> |
| <h2>Flags Affected</h2> |
| <p>None</p> |
| <h2>Intel C/C++ Compiler Intrinsic Equivalent</h2> |
| <p>Auto-generated from high-level language when possible.</p> |
| <p>unsigned int mulx_u32(unsigned int a, unsigned int b, unsigned int * hi);</p> |
| <p>unsigned __int64 mulx_u64(unsigned __int64 a, unsigned __int64 b, unsigned __int64 * hi);</p> |
| <h2>SIMD Floating-Point Exceptions</h2> |
| <p>None</p> |
| <h2>Other Exceptions</h2> |
| <p>See Section 2.5.1, “Exception Conditions for VEX-Encoded GPR Instructions”, Table 2-29; additionally</p> |
| <table class="exception-table"> |
| <tr> |
| <td>#UD</td> |
| <td>If VEX.W = 1.</td></tr></table></body></html> |