From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: schwab@linux-m68k.org, agraf@suse.de,
Richard Henderson <rth@twiddle.net>,
gerg@uclinux.org, Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH v2 1/3] target-m68k: add cmpm
Date: Thu, 27 Oct 2016 23:43:27 +0200 [thread overview]
Message-ID: <1477604609-2206-2-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1477604609-2206-1-git-send-email-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
target-m68k/translate.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index ee0ffe3..92e67eb 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -2173,6 +2173,33 @@ DISAS_INSN(cmpa)
gen_update_cc_cmp(s, reg, src, opsize);
}
+DISAS_INSN(cmpm)
+{
+ int opsize = insn_opsize(insn);
+ TCGv tmp = tcg_temp_new();
+ TCGv src, dst, addr;
+
+ src = gen_load(s, opsize, AREG(insn, 0), 1);
+ /* delay the update after the second gen_load() */
+ tcg_gen_addi_i32(tmp, AREG(insn, 0), opsize_bytes(opsize));
+
+ /* but if the we use the same address register to
+ * read the second value, we must use the updated address
+ */
+ if (REG(insn, 0) == REG(insn, 9)) {
+ addr = tmp;
+ } else {
+ addr = AREG(insn, 9);
+ }
+
+ dst = gen_load(s, opsize, addr, 1);
+ tcg_gen_mov_i32(AREG(insn, 0), tmp);
+ tcg_gen_addi_i32(AREG(insn, 9), addr, opsize_bytes(opsize));
+ tcg_temp_free(tmp);
+
+ gen_update_cc_cmp(s, dst, src, opsize);
+}
+
DISAS_INSN(eor)
{
TCGv src;
@@ -3414,6 +3441,7 @@ void register_m68k_insns (CPUM68KState *env)
INSN(cmpa, b1c0, f1c0, CF_ISA_A);
INSN(cmp, b000, f100, M68000);
INSN(eor, b100, f100, M68000);
+ INSN(cmpm, b108, f138, M68000);
INSN(cmpa, b0c0, f0c0, M68000);
INSN(eor, b180, f1c0, CF_ISA_A);
BASE(and, c000, f000);
--
2.7.4
next prev parent reply other threads:[~2016-10-27 21:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 21:43 [Qemu-devel] [PATCH v2 0/3] 680x0 instruction set, part 2 Laurent Vivier
2016-10-27 21:43 ` Laurent Vivier [this message]
2016-11-01 17:48 ` [Qemu-devel] [PATCH v2 1/3] target-m68k: add cmpm Richard Henderson
2016-11-01 19:58 ` Laurent Vivier
2016-10-27 21:43 ` [Qemu-devel] [PATCH v2 2/3] target-m68k: Inline shifts Laurent Vivier
2016-10-27 21:43 ` [Qemu-devel] [PATCH v2 3/3] target-m68k: shift ops manage word and byte operands Laurent Vivier
2016-10-28 17:42 ` 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=1477604609-2206-2-git-send-email-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=agraf@suse.de \
--cc=gerg@uclinux.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.