qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 06/55] target/mips: Add emulation of misc nan


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v4 06/55] target/mips: Add emulation of misc nanoMIPS 16-bit instructions
Date: Tue, 24 Jul 2018 12:27:50 -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:
> +    /* make sure instructions are on a halfword boundary */
> +    if (ctx->base.pc_next & 0x1) {
> +        TCGv tmp = tcg_const_tl(ctx->base.pc_next);
> +        tcg_gen_st_tl(tmp, cpu_env, offsetof(CPUMIPSState, CP0_BadVAddr));
> +        tcg_temp_free(tmp);
> +        return 2;
> +    }

You've lost the actual raising of the exception since v3.

> +    case NM_P16_MV:
> +        {
> +            int rt1 = NANOMIPS_EXTRACT_RD5(ctx->opcode);
> +            if (rt1 != 0) {
> +                /* MOVE */
> +                int rs1 = NANOMIPS_EXTRACT_RS5(ctx->opcode);
> +                gen_arith(ctx, OPC_ADDU, rt1, rs1, 0);

Why are you creating rt1 and rs1 variables?
I see you took my shadowed variables comment to heart, and renamed them, but
why not just overwrite the contents of the existing outer variable?

> +        case NM_P_ADDIURS5:
> +            {
> +                int rt1 = extract32(ctx->opcode, 5, 5);

Likewise.

> +    case NM_P16_4X4:
> +        {
> +            int rt1 = (extract32(ctx->opcode, 9, 1) << 3) |
> +                      extract32(ctx->opcode, 5, 3);
> +            int rs1 = (extract32(ctx->opcode, 4, 1) << 3) |
> +                      extract32(ctx->opcode, 0, 3);

Likewise.


r~



reply via email to

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