qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Michael Rolnik <mrolnik@gmail.com>, qemu-devel@nongnu.org
Cc: Sarah Harris <S.E.Harris@kent.ac.uk>, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH v21 4/7] target/avr: Add instruction translation
Date: Mon, 10 Jun 2019 13:09:23 -0700	[thread overview]
Message-ID: <c868749e-61ea-8f8a-51c1-e6b9b9d445c6@linaro.org> (raw)
In-Reply-To: <20190606193012.37715-5-mrolnik@gmail.com>

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~


  parent reply	other threads:[~2019-06-10 20:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 19:30 [Qemu-devel] [PATCH v21 0/7] QEMU AVR 8 bit cores Michael Rolnik
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 1/7] target/avr: Add outward facing interfaces and core CPU logic Michael Rolnik
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 2/7] target/avr: Add instruction helpers Michael Rolnik
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 3/7] target/avr: Add instruction decoding Michael Rolnik
2019-06-10 15:05   ` Richard Henderson
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 4/7] target/avr: Add instruction translation Michael Rolnik
2019-06-10 15:09   ` Richard Henderson
2019-06-10 20:09   ` Richard Henderson [this message]
2019-06-10 20:35   ` Richard Henderson
2019-06-10 20:50   ` Richard Henderson
2019-06-10 21:20   ` Richard Henderson
2019-06-11 20:21     ` Michael Rolnik
2019-06-11 20:47       ` Richard Henderson
2019-06-11 21:02         ` Michael Rolnik
2019-06-12 16:36           ` Richard Henderson
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 5/7] target/avr: Add limited support for USART and 16 bit timer peripherals Michael Rolnik
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 6/7] target/avr: Add example board configuration Michael Rolnik
2019-06-06 19:30 ` [Qemu-devel] [PATCH v21 7/7] target/avr: Register AVR support with the rest of QEMU, the build system, and the MAINTAINERS file Michael Rolnik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c868749e-61ea-8f8a-51c1-e6b9b9d445c6@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=S.E.Harris@kent.ac.uk \
    --cc=mrolnik@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).