Lines Matching refs:src_reg
203 static u8 add_2reg(u8 byte, u32 dst_reg, u32 src_reg) in add_2reg() argument
205 return byte + reg2hex[dst_reg] + (reg2hex[src_reg] << 3); in add_2reg()
666 static void emit_mov_reg(u8 **pprog, bool is64, u32 dst_reg, u32 src_reg) in emit_mov_reg() argument
673 EMIT_mov(dst_reg, src_reg); in emit_mov_reg()
676 if (is_ereg(dst_reg) || is_ereg(src_reg)) in emit_mov_reg()
677 EMIT1(add_2mod(0x40, dst_reg, src_reg)); in emit_mov_reg()
678 EMIT2(0x89, add_2reg(0xC0, dst_reg, src_reg)); in emit_mov_reg()
685 static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off) in emit_ldx() argument
693 EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB6); in emit_ldx()
697 EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB7); in emit_ldx()
701 if (is_ereg(dst_reg) || is_ereg(src_reg)) in emit_ldx()
702 EMIT2(add_2mod(0x40, src_reg, dst_reg), 0x8B); in emit_ldx()
708 EMIT2(add_2mod(0x48, src_reg, dst_reg), 0x8B); in emit_ldx()
717 EMIT2(add_2reg(0x40, src_reg, dst_reg), off); in emit_ldx()
719 EMIT1_off32(add_2reg(0x80, src_reg, dst_reg), off); in emit_ldx()
724 static void emit_stx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off) in emit_stx() argument
732 if (is_ereg(dst_reg) || is_ereg_8l(src_reg)) in emit_stx()
734 EMIT2(add_2mod(0x40, dst_reg, src_reg), 0x88); in emit_stx()
739 if (is_ereg(dst_reg) || is_ereg(src_reg)) in emit_stx()
740 EMIT3(0x66, add_2mod(0x40, dst_reg, src_reg), 0x89); in emit_stx()
745 if (is_ereg(dst_reg) || is_ereg(src_reg)) in emit_stx()
746 EMIT2(add_2mod(0x40, dst_reg, src_reg), 0x89); in emit_stx()
751 EMIT2(add_2mod(0x48, dst_reg, src_reg), 0x89); in emit_stx()
755 EMIT2(add_2reg(0x40, dst_reg, src_reg), off); in emit_stx()
757 EMIT1_off32(add_2reg(0x80, dst_reg, src_reg), off); in emit_stx()
781 if (insn->dst_reg == BPF_REG_6 || insn->src_reg == BPF_REG_6) in detect_reg_usage()
783 if (insn->dst_reg == BPF_REG_7 || insn->src_reg == BPF_REG_7) in detect_reg_usage()
785 if (insn->dst_reg == BPF_REG_8 || insn->src_reg == BPF_REG_8) in detect_reg_usage()
787 if (insn->dst_reg == BPF_REG_9 || insn->src_reg == BPF_REG_9) in detect_reg_usage()
821 u32 src_reg = insn->src_reg; in do_jit() local
848 EMIT1(add_2mod(0x48, dst_reg, src_reg)); in do_jit()
849 else if (is_ereg(dst_reg) || is_ereg(src_reg)) in do_jit()
850 EMIT1(add_2mod(0x40, dst_reg, src_reg)); in do_jit()
851 EMIT2(b2, add_2reg(0xC0, dst_reg, src_reg)); in do_jit()
858 dst_reg, src_reg); in do_jit()
947 EMIT_mov(AUX_REG, src_reg); in do_jit()
998 emit_mov_reg(&prog, is64, BPF_REG_0, src_reg); in do_jit()
1056 if (src_reg != BPF_REG_4) { /* common case */ in do_jit()
1060 EMIT_mov(BPF_REG_4, src_reg); in do_jit()
1076 if (src_reg != BPF_REG_4) in do_jit()
1176 emit_stx(&prog, BPF_SIZE(insn->code), dst_reg, src_reg, insn->off); in do_jit()
1188 emit_ldx(&prog, BPF_SIZE(insn->code), dst_reg, src_reg, insn->off); in do_jit()
1236 if (is_ereg(dst_reg) || is_ereg(src_reg)) in do_jit()
1237 EMIT3(0xF0, add_2mod(0x40, dst_reg, src_reg), 0x01); in do_jit()
1242 EMIT3(0xF0, add_2mod(0x48, dst_reg, src_reg), 0x01); in do_jit()
1244 EMIT2(add_2reg(0x40, dst_reg, src_reg), insn->off); in do_jit()
1246 EMIT1_off32(add_2reg(0x80, dst_reg, src_reg), in do_jit()
1299 EMIT1(add_2mod(0x48, dst_reg, src_reg)); in do_jit()
1300 else if (is_ereg(dst_reg) || is_ereg(src_reg)) in do_jit()
1301 EMIT1(add_2mod(0x40, dst_reg, src_reg)); in do_jit()
1302 EMIT2(0x39, add_2reg(0xC0, dst_reg, src_reg)); in do_jit()
1309 EMIT1(add_2mod(0x48, dst_reg, src_reg)); in do_jit()
1310 else if (is_ereg(dst_reg) || is_ereg(src_reg)) in do_jit()
1311 EMIT1(add_2mod(0x40, dst_reg, src_reg)); in do_jit()
1312 EMIT2(0x85, add_2reg(0xC0, dst_reg, src_reg)); in do_jit()