public override RiscVInstruction Decode(RiscVDisassembler dasm, uint wInstr) { var slot = (int)((wInstr >> shift) & mask); if (!subcodes.TryGetValue(slot, out Decoder decoder)) { return(dasm.CreateInvalidInstruction()); } return(decoder.Decode(dasm, wInstr)); }
public override RiscVInstruction Decode(uint hInstr, RiscVDisassembler dasm) { if (!dasm.rdr.TryReadUInt16(out ushort hiword)) { return(dasm.CreateInvalidInstruction()); } uint wInstr = (uint)hiword << 16; wInstr |= hInstr; return(subDecoders.Decode(wInstr, dasm)); }
public override RiscVInstruction Decode(RiscVDisassembler dasm, uint hInstr) { if (!dasm.rdr.TryReadUInt16(out ushort hiword)) { return(dasm.CreateInvalidInstruction()); } uint wInstr = (uint)hiword << 16; wInstr |= hInstr; var slot = (wInstr >> 2) & 0x1F; return(w32decoders[slot].Decode(dasm, wInstr)); }
public override RiscVInstruction Decode(uint wInstr, RiscVDisassembler dasm) { dasm.state.instr.InstructionClass = InstrClass.Linear; dasm.state.instr.Mnemonic = opcode; dasm.state.ops.Clear(); foreach (var m in mutators) { if (!m(wInstr, dasm)) { return(dasm.CreateInvalidInstruction()); } } return(dasm.MakeInstruction()); }
public override RiscVInstruction Decode(RiscVDisassembler dasm, uint wInstr) { dasm.state.instr.InstructionClass = this.iclass; dasm.state.instr.opcode = opcode; dasm.state.ops.Clear(); foreach (var m in mutators) { if (!m(wInstr, dasm)) { return(dasm.CreateInvalidInstruction()); } } return(dasm.MakeInstruction()); }