ALU (Arithmetic Logic Unit) operations for BPF programs.
Provides 32-bit and 64-bit arithmetic operations:
ALU (Arithmetic Logic Unit) operations for BPF programs. Provides 32-bit and 64-bit arithmetic operations: - Arithmetic: add, sub, mul, div, mod, neg - Bitwise: and, or, xor, lsh, rsh, arsh - Data movement: mov - Endianness conversion: end-to-be, end-to-le
(add dst imm)Add immediate to register.
dst += imm
Add immediate to register. dst += imm
(add-reg dst src)Add register to register.
dst += src
Add register to register. dst += src
(add32 dst imm)Add immediate to register (32-bit).
(u32)dst += imm
Add immediate to register (32-bit). (u32)dst += imm
(add32-reg dst src)Add register to register (32-bit).
(u32)dst += (u32)src
Add register to register (32-bit). (u32)dst += (u32)src
Map of ALU operation keywords to BPF opcodes
Map of ALU operation keywords to BPF opcodes
(alu32-imm op dst imm)32-bit ALU operation with immediate source.
(u32)dst = (u32)dst OP imm
Arguments:
32-bit ALU operation with immediate source. (u32)dst = (u32)dst OP imm Arguments: - op: Operation keyword (:add, :sub, :mul, etc.) - dst: Destination register - imm: Immediate value (32-bit)
(alu32-reg op dst src)32-bit ALU operation with register source.
(u32)dst = (u32)dst OP (u32)src
Arguments:
32-bit ALU operation with register source. (u32)dst = (u32)dst OP (u32)src Arguments: - op: Operation keyword (:add, :sub, :mul, etc.) - dst: Destination register - src: Source register
(alu64-imm op dst imm)64-bit ALU operation with immediate source.
dst = dst OP imm
Arguments:
64-bit ALU operation with immediate source. dst = dst OP imm Arguments: - op: Operation keyword (:add, :sub, :mul, etc.) - dst: Destination register - imm: Immediate value (32-bit)
(alu64-reg op dst src)64-bit ALU operation with register source.
dst = dst OP src
Arguments:
64-bit ALU operation with register source. dst = dst OP src Arguments: - op: Operation keyword (:add, :sub, :mul, etc.) - dst: Destination register - src: Source register
(and-op dst imm)Bitwise AND register with immediate.
dst &= imm
Bitwise AND register with immediate. dst &= imm
(and-reg dst src)Bitwise AND register with register.
dst &= src
Bitwise AND register with register. dst &= src
(arsh dst imm)Arithmetic right shift by immediate.
dst >>>= imm (preserving sign)
Arithmetic right shift by immediate. dst >>>= imm (preserving sign)
(arsh-reg dst src)Arithmetic right shift by register.
dst >>>= src (preserving sign)
Arithmetic right shift by register. dst >>>= src (preserving sign)
(bswap16 dst)Byte swap 16-bit value (big-endian to little-endian or vice versa).
Byte swap 16-bit value (big-endian to little-endian or vice versa).
(div dst imm)Divide register by immediate.
dst /= imm
Divide register by immediate. dst /= imm
(div-reg dst src)Divide register by register.
dst /= src
Divide register by register. dst /= src
(end-to-be dst size)Convert register to big-endian.
Arguments:
Convert register to big-endian. Arguments: - dst: Register to convert - size: Size in bits (16, 32, or 64)
(end-to-le dst size)Convert register to little-endian.
Arguments:
Convert register to little-endian. Arguments: - dst: Register to convert - size: Size in bits (16, 32, or 64)
(lsh dst imm)Left shift register by immediate.
dst <<= imm
Left shift register by immediate. dst <<= imm
(lsh-reg dst src)Left shift register by register.
dst <<= src
Left shift register by register. dst <<= src
(mod-op dst imm)Modulo register by immediate.
dst %= imm
Modulo register by immediate. dst %= imm
(mod-reg dst src)Modulo register by register.
dst %= src
Modulo register by register. dst %= src
(mov dst imm)Move immediate to register (64-bit).
dst = imm
Arguments:
Move immediate to register (64-bit). dst = imm Arguments: - dst: Destination register - imm: Immediate value (32-bit, sign-extended to 64-bit)
(mov-reg dst src)Move register to register (64-bit).
dst = src
Arguments:
Move register to register (64-bit). dst = src Arguments: - dst: Destination register - src: Source register
(mov32 dst imm)Move immediate to register (32-bit).
(u32)dst = imm
Arguments:
Move immediate to register (32-bit). (u32)dst = imm Arguments: - dst: Destination register - imm: Immediate value (32-bit)
(mov32-reg dst src)Move register to register (32-bit).
(u32)dst = (u32)src
Arguments:
Move register to register (32-bit). (u32)dst = (u32)src Arguments: - dst: Destination register - src: Source register
(mul dst imm)Multiply register by immediate.
dst *= imm
Multiply register by immediate. dst *= imm
(mul-reg dst src)Multiply register by register.
dst *= src
Multiply register by register. dst *= src
(or-op dst imm)Bitwise OR register with immediate.
dst |= imm
Bitwise OR register with immediate. dst |= imm
(or-reg dst src)Bitwise OR register with register.
dst |= src
Bitwise OR register with register. dst |= src
(rsh dst imm)Right shift register by immediate (logical).
dst >>= imm
Right shift register by immediate (logical). dst >>= imm
(rsh-reg dst src)Right shift register by register (logical).
dst >>= src
Right shift register by register (logical). dst >>= src
(sub dst imm)Subtract immediate from register.
dst -= imm
Subtract immediate from register. dst -= imm
(sub-reg dst src)Subtract register from register.
dst -= src
Subtract register from register. dst -= src
(sub32 dst imm)Subtract immediate from register (32-bit).
(u32)dst -= imm
Subtract immediate from register (32-bit). (u32)dst -= imm
(sub32-reg dst src)Subtract register from register (32-bit).
(u32)dst -= (u32)src
Subtract register from register (32-bit). (u32)dst -= (u32)src
(xor-op dst imm)Bitwise XOR register with immediate.
dst ^= imm
Bitwise XOR register with immediate. dst ^= imm
(xor-reg dst src)Bitwise XOR register with register.
dst ^= src
Bitwise XOR register with register. dst ^= src
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |