ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

BPF_MOD

T1 ebpf alu insn
eBPF BPF_MOD (ALU)
SourceIETF RFC 9669 Official eBPF Instruction Set Architecture v1.0 (ebpf_rfc9669)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeeBPF ISA v1.0 (IETF RFC 9669)
Linux / Windows / Hardware eBPF VMs
License & VersionIETF Trust Legal Provisions
RFC 9669
Upstreamhttps://www.rfc-editor.org/rfc/rfc9669.txt
Privilegeuser
Extensionsdivmul32, divmul64

Summary

Unsigned/signed modulo remainder.

Syntax / Encoding

BPF_MOD [opcodes: 0x94, 0x9c, 0x97, 0x9f] — dst = (src != 0) ? (dst % src) : dst (off=0 unsigned, off=1 signed SMOD)

Binary Encodings (4)

WidthFormatBit PatternMask / Match
64eBPF-ALUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx100101000xff / 0x94
64eBPF-ALUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx100111000xff / 0x9c
64eBPF-ALUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx100101110xff / 0x97
64eBPF-ALUxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx100111110xff / 0x9f

Operands

NameDescription
dst_regDestination register
src_reg / immSource register (X) or signed 32-bit immediate (K)