x86: introduce <hl> template
A new template `<hl>` is introduced in the x86 opcode table to simplify the definition of instructions involving high and low byte operations.
This patch introduces a new template named <hl> into the x86 opcode table in binutils. This template aims to reduce redundancy in defining instructions that operate on high and low parts of registers or memory, similar to existing patterns for VPINTERLEAVE instructions. It simplifies the encoding of instructions like PMULHW/PMULLW.
- proposer
Introduces a new opcode template `<hl>` for x86 instructions to simplify the definition of operations involving high and low parts, citing VPINTERLEAVE as a similar pattern.
“<hl:mov:fp:int:mul:shuf, h:4:1:8:e5:f3, l:0:0:0:d5:f2>”
In Details
The patch modifies opcodes/i386-opc.tbl to add a new template <hl>. This template is designed to abstract the common patterns found in x86 instructions that involve high (h) and low (l) byte/word operations, particularly for multiply instructions like pmulhw and pmullw. It consolidates the encoding logic, reducing verbosity and potential errors in the opcode table.
- opcode table
- A data structure used by assemblers and disassemblers to map mnemonic instructions to their binary machine code representations.
- template
- In this context, a reusable pattern or macro within the opcode table definition to represent common instruction formats.
- x86
- A family of instruction set architectures developed by Intel, widely used in personal computers and servers.
- VPINTERLEAVE
- AVX-512 instructions that interleave data elements from two sources into a destination.
- PMULHW
- Packed Multiply High Word, an MMX or SSE instruction that multiplies the high words of packed integers.
- PMULLW
- Packed Multiply Low Word, an MMX or SSE instruction that multiplies the low words of packed integers.