On 07/19/2018 05:54 AM, Stefan Markovic wrote: > +static int decode_gpr_gpr3(int r) > +{ > + static const int map[] = { 16, 17, 18, 19, 4, 5, 6, 7 }; > + > + return map[r & 0x7]; > +} > + > +static int decode_gpr_gpr4(int r) > +{ > + static const int map[] = { 8, 9, 10, 11, 4, 5, 6, 7, > + 16, 17, 18, 19, 20, 21, 22, 23 }; > + > + return map[r & 0xf]; > +} > + > +/* Used for 16-bit store instructions. */ > +static int decode_gpr_gpr4_zero(int r)
I think it's worth spending one line to document the pseudocode function from which each of these come. E.g. /* Implement nanoMIPS pseudocode decode_gpr(encoded_gpr, 'gpr4.zero'). */ Which is certainly more accurate than the comment that is there currently. Otherwise, Reviewed-by: Richard Henderson <richard.hender...@linaro.org> r~