Bpf.bpf_alu: def of bend-osdev-bpf@0.1.0.0 Import: import bend-osdev-bpf@0.1.0.0/bpf.bend as Bpf Lines 225-247 of bend-osdev-bpf@0.1.0.0/bpf.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-bpf@0.1.0.0/bpf.bend&start_line=225&end_line=247 import Base import bend-osdev-bpf@0.1.0.0/insn.bend as I # A op v, or None for a division or modulo by zero def bpf_alu(o: I.BpfAluOp, +a: U32, +v: U32) -> Maybe<&2, U32>: match o: case I.BpfAdd{}: Some{U32.add(a, v)} case I.BpfSub{}: Some{U32.sub(a, v)} case I.BpfMul{}: Some{U32.mul(a, v)} case I.BpfDiv{}: bpf_div(U32.is_zero(v), a, v) case I.BpfOr{}: Some{U32.or(a, v)} case I.BpfAnd{}: Some{U32.and(a, v)} case I.BpfLsh{}: Some{bpf_shl(U32.is_lt(v, 32), a, v)} case I.BpfRsh{}: Some{bpf_shr(U32.is_lt(v, 32), a, v)} case I.BpfMod{}: bpf_mod(U32.is_zero(v), a, v) case I.BpfXor{}: Some{U32.xor(a, v)} Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_zero https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/bpf.bend&name=bpf_div https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/bpf.bend&name=bpf_mod https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/bpf.bend&name=bpf_shl https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/bpf.bend&name=bpf_shr https://jend.leeeet.dev/definition.txt?path=bend-osdev-bpf@0.1.0.0/insn.bend&name=BpfAluOp