instruction set decoding

Posted:
Wed Jul 03, 2013 1:09 pm
by Gravis
at the end of the it lists the "Epiphany Instruction Decode Table" which is rather complex because of it's format. instead of normal opcodes, there are many different formats to consider. i'm working on an emulator of the Epiphany chip and i to keep the code clear and concise. so, what is the optimal method of determining the instruction?
Re: instruction set decoding

Posted:
Wed Jul 03, 2013 3:00 pm
by Hoernchen
Re-ordering that table and grouping by bits 3:0 and then using a lookup table for those bits to narrow it down, then checking the other bits is the first thing that comes to mind.
Or adding the instruction encoding to llvm and abusing tablegen/disassembler backend...
(I'd also like to have that table as an actual table)
Re: instruction set decoding

Posted:
Fri Jul 05, 2013 2:19 pm
by Gravis
i switched my code to use just a series of switch tables (none embedded) taking the instruction and masking it in different ways for each table to always hit an exact value which creates smaller code than ranges. very straight forward and faster than before.
