qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 07/55] target/mips: Add emulation of nanoMIPS


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v4 07/55] target/mips: Add emulation of nanoMIPS 16-bit load and store instructions
Date: Tue, 24 Jul 2018 12:34:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 07/24/2018 10:31 AM, Aleksandar Markovic wrote:
> +            case NM_SB16:
> +                {
> +                    int rt = decode_gpr_gpr3_src_store(
> +                                 NANOMIPS_EXTRACT_RD(ctx->opcode));

Shadowed variable.

> +            case NM_SH16:
> +                {
> +                    int rt = decode_gpr_gpr3_src_store(
> +                                 NANOMIPS_EXTRACT_RD(ctx->opcode));

Likewise.

>      case NM_LWSP16:
> +        {
> +            int rt = NANOMIPS_EXTRACT_RD5(ctx->opcode);

Likewise.

>      case NM_LW4X4:
> +        {
> +            int rt = (extract32(ctx->opcode, 9, 1) << 3) |
> +                     extract32(ctx->opcode, 5, 3);
> +            int rs = (extract32(ctx->opcode, 4, 1) << 3) |
> +                     extract32(ctx->opcode, 0, 3);

Likewise.

>      case NM_SW4X4:
> +        {
> +            int rt = (extract32(ctx->opcode, 9, 1) << 3) |
> +                     extract32(ctx->opcode, 5, 3);
> +            int rs = (extract32(ctx->opcode, 4, 1) << 3) |
> +                     extract32(ctx->opcode, 0, 3);

Likewise.

>      case NM_SWSP16:
> +        {
> +            int rt = NANOMIPS_EXTRACT_RD5(ctx->opcode);

Likewise.

>      case NM_SW16:
> +        {
> +            int rt = decode_gpr_gpr3_src_store(
> +                         NANOMIPS_EXTRACT_RD(ctx->opcode));
> +            int rs = decode_gpr_gpr3(NANOMIPS_EXTRACT_RS(ctx->opcode));

Likewise.

>      case NM_SWGP16:
> +        {
> +            int rt = decode_gpr_gpr3_src_store(
> +                         NANOMIPS_EXTRACT_RD(ctx->opcode));

Likewise.

It might be handy to temporarily add

target/mips/translate.o: QEMU_CFLAGS += -Wshadow=local

to target/mips/Makefile.objs, but I don't know how prevalent that situation is
within the existing code base...


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]