Lines Matching refs:opc
83 let mut entry = |name: &str, inst_type: InstructionType, opc: u8| { in make_instruction_map()
84 result.insert(name.to_string(), (inst_type, opc)) in make_instruction_map()
99 for &(name, opc) in &alu_binary_ops { in make_instruction_map()
100 entry(name, AluBinary, ebpf::BPF_ALU64 | opc); in make_instruction_map()
101 entry(&format!("{name}32"), AluBinary, ebpf::BPF_ALU | opc); in make_instruction_map()
102 entry(&format!("{name}64"), AluBinary, ebpf::BPF_ALU64 | opc); in make_instruction_map()
154 fn insn(opc: u8, dst: i64, src: i64, off: i64, imm: i64) -> Result<Insn, String> { in insn()
168 opc, in insn()
187 fn encode(inst_type: InstructionType, opc: u8, operands: &[Operand]) -> Result<Insn, String> { in encode()
190 (AluBinary, Register(dst), Register(src), Nil) => insn(opc | ebpf::BPF_X, dst, src, 0, 0), in encode()
191 (AluBinary, Register(dst), Integer(imm), Nil) => insn(opc | ebpf::BPF_K, dst, 0, 0, imm), in encode()
192 (AluUnary, Register(dst), Nil, Nil) => insn(opc, dst, 0, 0, 0), in encode()
193 (LoadAbs, Integer(imm), Nil, Nil) => insn(opc, 0, 0, 0, imm), in encode()
194 (LoadInd, Register(src), Integer(imm), Nil) => insn(opc, 0, src, 0, imm), in encode()
196 | (StoreReg, Memory(dst, off), Register(src), Nil) => insn(opc, dst, src, off, 0), in encode()
197 (StoreImm, Memory(dst, off), Integer(imm), Nil) => insn(opc, dst, 0, off, imm), in encode()
198 (NoOperand, Nil, Nil, Nil) => insn(opc, 0, 0, 0, 0), in encode()
199 (JumpUnconditional, Integer(off), Nil, Nil) => insn(opc, 0, 0, off, 0), in encode()
201 insn(opc | ebpf::BPF_X, dst, src, off, 0) in encode()
204 insn(opc | ebpf::BPF_K, dst, 0, off, imm) in encode()
206 (Call, Integer(imm), Nil, Nil) => insn(opc, 0, 0, 0, imm), in encode()
207 (Endian(size), Register(dst), Nil, Nil) => insn(opc, dst, 0, 0, size), in encode()
208 (LoadImm, Register(dst), Integer(imm), Nil) => insn(opc, dst, 0, 0, (imm << 32) >> 32), in encode()
219 Some(&(inst_type, opc)) => { in assemble_internal()
220 match encode(inst_type, opc, &instruction.operands) { in assemble_internal()