binutils Newspaper
NOVEMBER 30, 2026
bpf — Proposed — Sentiment 8 / 10

bpf: add ISA v5 and uhmul,shmul instructions [PR34880]

Adds support for BPF ISA version 5 and its new UHMUL/SHMUL instructions to the GNU Assembler.

David Faust submits a patch to binutils to add support for BPF ISA version 5, which introduces two new instructions: UHMUL (unsigned high-half 64-bit multiply) and SHMUL (signed high-half 64-bit multiply). These instructions are encoded as variants of the ALU64 MUL instruction. The patch updates the assembler and disassembler to default to ISA v5 and includes necessary changes to opcode definitions and documentation.

In the Thread 4 participants
  1. David Faust proposer

    Submitted a patch to add support for BPF ISA version 5 and the new UHMUL/SHMUL instructions, updating the assembler and disassembler defaults.

    “This patch adds ISA v5 and support for the new instructions. As is custom for BPF, the default ISA selected by the assembler and disassembler is updated to the latest, now v5.”
  2. Jose E. Marchesi reviewer

    Reviewed the patch, specifically noting a detail in the opcodes/bpf-opc.c diff regarding the encoding of new instructions.

    “Hi Faust. > diff --git a/opcodes/bpf-opc.c b/opcodes/bpf-opc.c > index 05503c338ad..e59081e5664 100644 > --- a/opcodes/bpf-opc.c > +++ b/opcodes/bpf-opc.c > @@ -41,6 +41,14 @@ const struct bpf_opcode bpf_opcodes[] = > BPF_V1, BPF_CODE, BPF_CLASS_ALU64|BPF_CODE_SUB|BPF_SRC_X}, > {BPF_INSN_SUBI, "sub%W%dr , %i32", "%dr -= %i32", > BPF_V1, BPF_CODE, BPF_CLASS_ALU64|BPF_CODE_SUB|BPF_SRC…”
  3. Vineet Gupta contributor

    Suggested CC'ing Alexei and Yonghong on the patch.

    “+CC Alexei and Yonghong”
  4. David Faust proposer

    Responded to Jose's comment and provided the full diff context again.

    “On 10/23/26 1:29 PM, Jose E. Marchesi wrote: > > Hi Faust. > >> diff --git a/opcodes/bpf-opc.c b/opcodes/bpf-opc.c >> index 05503c338ad..e59081e5664 100644 >> --- a/opcodes/bpf-opc.c >> +++ b/opcodes/bpf-opc.c >> @@ -41,6 +41,14 @@ const struct bpf_opcode bpf_opcodes[] = >> BPF_V1, BPF_CODE, BPF_CLASS_ALU64|BPF_CODE_SUB|BPF_SRC_X}, >> {BPF_INSN_SUBI, "sub%W%dr , %i32", "%dr -= %i32", >>…”

Technical Tradeoffs

  • Updating the default ISA might affect existing code if new instructions are implicitly used or if default behavior changes.
  • The new instructions' encoding relies on a field previously unused or used differently, requiring careful validation.
  • Ensuring backward compatibility for older BPF versions if needed.

In Details

This patch adds support for the newly introduced BPF ISA version 5 to GNU Binutils, specifically the assembler (gas) and disassembler. ISA v5 includes two new 64-bit multiply instructions, UHMUL and SHMUL, which are encoded as variants of the ALU64 MUL instruction by utilizing the offset16 field. The patch updates the assembler's configuration, opcode definitions, and documentation to reflect these changes, and sets BPF_V5 as the new default ISA.

For Context
BPF
Berkeley Packet Filter, an in-kernel virtual machine and programming interface commonly used for network packet processing and system tracing.
ISA
Instruction Set Architecture, defines the set of instructions that a processor can understand and execute.
UHMUL
Unsigned High-half Multiply, a BPF instruction that performs a 64-bit multiplication and returns the most significant 64 bits of the result.
SHMUL
Signed High-half Multiply, a BPF instruction that performs a signed 64-bit multiplication and returns the most significant 64 bits of the result.
ALU64
Arithmetic Logic Unit operating on 64-bit operands, a common component in modern processors and instruction sets like BPF.
gas
The GNU Assembler, part of the GNU Binutils package, responsible for translating assembly language into machine code.
PR34880
Patch Request number 34880, a unique identifier for a bug report or feature request in the binutils issue tracker.
Filed Under: binutilsgasbpfisainstructions