Re: [PATCH 1/5] MIPS: Optimize uasm insn lookup.

2017-05-26 Thread David Daney
On 05/26/2017 01:07 AM, Matt Redfearn wrote: [...] -{ insn_lwx, 0, 0 }, -{ insn_ldx, 0, 0 }, -{ insn_invalid, 0, 0 } +static struct insn insn_table_MM[insn_invalid] = { ^ You could make this const too, like you have the one in uasm-mips.c. Good catch. I meant to do that. I will

Re: [PATCH 1/5] MIPS: Optimize uasm insn lookup.

2017-05-26 Thread Matt Redfearn
Hi David, On 26/05/17 01:38, David Daney wrote: Instead of doing a linear search through the insn_table for each instruction, use the opcode as direct index into the table. This will give constant time lookup performance as the number of supported opcodes increases. Make the tables const as t

[PATCH 1/5] MIPS: Optimize uasm insn lookup.

2017-05-25 Thread David Daney
Instead of doing a linear search through the insn_table for each instruction, use the opcode as direct index into the table. This will give constant time lookup performance as the number of supported opcodes increases. Make the tables const as they are only ever read. For uasm-mips.c sort the tab