LumenIR / llr

Other
0 stars 0 forks source link

Модернизация backend tablegen disassembler в декодер #2

Open grishasobol opened 6 years ago

gvozdarev-sa commented 6 years ago

I offer following design. The switch case should be generated by tablegen backend inside LLR Also I think is good idea to create LLRInstBuilder

class LLRDecoder {
MCDisassembler disasm;

DecodeStatus decode(LLRInst llr_inst, ArrayRef data, ...) {
  MCInst mc_inst;
  DecodeStatus status disasm.getInstruction(mc_inst, data, ....);

  if (OK) {
    llr_inst.setMCInst(mc_inst);

    switch(mc_inst.getID())
    case ADD: {
      llr_inst.setExecutionFunction(execute_add)
      break;
    }
  }
}

}