[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 05/40] target/mips: Add nanoMIPS decoding and
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v3 05/40] target/mips: Add nanoMIPS decoding and extraction utilities |
Date: |
Thu, 19 Jul 2018 09:57:32 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
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 <address@hidden>
r~
- Re: [Qemu-devel] [PATCH v3 23/40] target/mips: Implement emulation of nanoMIPS LLWP/SCWP pair, (continued)
- [Qemu-devel] [PATCH v3 01/40] target/mips: Add preprocessor constants for nanoMIPS, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 30/40] target/mips: Adjust set_pc() for nanoMIPS, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 16/40] target/mips: Implement emulation of nanoMIPS ROTX instruction, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 13/40] target/mips: Add emulation of misc nanoMIPS instructions (pool32a0), Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 05/40] target/mips: Add nanoMIPS decoding and extraction utilities, Stefan Markovic, 2018/07/19
- Re: [Qemu-devel] [PATCH v3 05/40] target/mips: Add nanoMIPS decoding and extraction utilities,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 22/40] target/mips: Add handling of branch delay slots for nanoMIPS, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 08/40] target/mips: Add emulation of nanoMIPS 16-bit logic instructions, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 04/40] target/mips: Add decode_nanomips_opc() function, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 09/40] target/mips: Add emulation of nanoMIPS 16-bit save and restore instructions, Stefan Markovic, 2018/07/19
- [Qemu-devel] [PATCH v3 21/40] target/mips: Implement DSP ASE support for nanoMIPS, Stefan Markovic, 2018/07/19