qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Laurent Vivier <laurent@vivier.eu>, qemu-devel@nongnu.org
Cc: schwab@linux-m68k.org, agraf@suse.de, gerg@uclinux.org
Subject: Re: [Qemu-devel] [PATCH v2 2/3] target-m68k: implement 680x0 movem
Date: Thu, 3 Nov 2016 13:47:26 -0600	[thread overview]
Message-ID: <3a298435-672c-47ec-26d0-8b1cb78500dc@twiddle.net> (raw)
In-Reply-To: <1478121319-31986-3-git-send-email-laurent@vivier.eu>

On 11/02/2016 03:15 PM, Laurent Vivier wrote:
> +                    if ((insn & 7) + 8 == i &&
> +                        m68k_feature(s->env, M68K_FEATURE_EXT_FULL)) {
> +                        /* M68020+: if the addressing register is the
> +                         * register moved to memory, the value written
> +                         * is the initial value decremented by the size of
> +                         * the operation
> +                         * M68000/M68010: the value is the initial value
> +                         */
> +                        TCGv tmp = tcg_temp_new();
> +                        tcg_gen_sub_i32(tmp, mreg(i), incr);
> +                        gen_store(s, opsize, addr, tmp);
> +                        tcg_temp_free(tmp);

This doesn't look right.  Is the value stored the intermediate value of the 
decremented register, or the final value?  What you're storing is reg-4, which 
is neither of these things.

I could see, maybe, that reg-4 might well turn out to be the right value for

	movem	{a0-a7}, (sp)-

since sp == a7, and therefore stored first.  But I question that's the correct 
result for

	movem	{a0-a7}, (a1)-

If it's the incremental value, then you can just store "addr" and you don't 
need a temp.  If it's the final value, then you can compute

	tcg_gen_subi_i32(tmp, AREG(insn, 0), ctpop32(mask) * 4);



r~

  parent reply	other threads:[~2016-11-03 19:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 21:15 [Qemu-devel] [PATCH v2 0/3] target-m68k: add movem, BCD and CAS instructions Laurent Vivier
2016-11-02 21:15 ` [Qemu-devel] [PATCH v2 1/3] target-m68k: add abcd/sbcd/nbcd Laurent Vivier
2016-11-03 16:16   ` Richard Henderson
2016-11-02 21:15 ` [Qemu-devel] [PATCH v2 2/3] target-m68k: implement 680x0 movem Laurent Vivier
2016-11-03 16:17   ` Richard Henderson
2016-11-03 19:47   ` Richard Henderson [this message]
2016-11-03 20:11     ` Laurent Vivier
2016-11-03 20:45       ` Richard Henderson
2016-11-03 20:47   ` Richard Henderson
2016-11-04  7:59     ` Laurent Vivier
2016-11-04 12:27       ` Richard Henderson
2016-11-02 21:15 ` [Qemu-devel] [PATCH v2 3/3] target-m68k: add cas/cas2 ops Laurent Vivier
2016-11-03 16:36   ` Richard Henderson
2016-11-03 18:03     ` Laurent Vivier
2016-11-03 19:20       ` Richard Henderson

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=3a298435-672c-47ec-26d0-8b1cb78500dc@twiddle.net \
    --to=rth@twiddle.net \
    --cc=agraf@suse.de \
    --cc=gerg@uclinux.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=schwab@linux-m68k.org \
    /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).