|
| From: | Richard Henderson |
| Subject: | Re: [Qemu-devel] [PATCH v21 4/7] target/avr: Add instruction translation |
| Date: | Mon, 10 Jun 2019 13:09:23 -0700 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/6/19 12:30 PM, Michael Rolnik wrote:
> + target_long cpc;
> + target_long npc;
CPC gets copied back and forth to NPC, but is now otherwise unused.
You can drop that.
> +static void translate(DisasContext *ctx)
> +{
> + uint32_t opcode;
> + int res;
> + /* PC points to words. */
> + opcode = cpu_ldl_code(ctx->env, ctx->cpc * 2) & 0x0000ffff;
> +
> + ctx->npc = ctx->cpc + 1;
Which allows this to become
uint32_t opcode = next_word(ctx);
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |