MCPcopy Create free account
hub / github.com/D7EAD/mkPIVM / enc_shift

Function enc_shift

src/codec.cpp:1721–1733  ·  view source on GitHub ↗

shifts

Source from the content-addressed store, hash-verified

1719
1720 // shifts
1721 static void enc_shift(BytecodeBuilder& out, const IRInsn& i, const VMConfig& vm, const Codec* self) {
1722 out.u8(vm.opcode_for(self->family()));
1723 enc_slot(out, vm, get_op<VirReg>(i, 0));
1724 if (std::holds_alternative<Imm>(i.ops[1])) {
1725 out.u8(1);
1726 const auto& im = get_op<Imm>(i, 1);
1727 out.u8(static_cast<std::uint8_t>(im.value & 0xFF));
1728 }
1729 else {
1730 out.u8(0);
1731 enc_slot(out, vm, get_op<VirReg>(i, 1));
1732 }
1733 }
1734
1735 static void emit_shift_handler(X64Emitter& e, const VMConfig& vm, void (X64Emitter::*op_cl)(std::uint8_t, bool)) {
1736 const auto& r = vm.dispatcher_regs();

Callers 1

encodeMethod · 0.85

Calls 4

enc_slotFunction · 0.85
opcode_forMethod · 0.80
u8Method · 0.45
familyMethod · 0.45

Tested by

no test coverage detected