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 03/17] target-m68k: add exg ops
Date: Thu, 27 Oct 2016 02:42:16 +0200 [thread overview]
Message-ID: <1477528950-8115-4-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1477528950-8115-1-git-send-email-laurent@vivier.eu>
Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
target-m68k/translate.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 0d3111d..b407623 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -2021,6 +2021,33 @@ DISAS_INSN(eor)
DEST_EA(env, insn, OS_LONG, dest, &addr);
}
+static void do_exg(TCGv reg1, TCGv reg2)
+{
+ TCGv temp = tcg_temp_new();
+ tcg_gen_mov_i32(temp, reg1);
+ tcg_gen_mov_i32(reg1, reg2);
+ tcg_gen_mov_i32(reg2, temp);
+ tcg_temp_free(temp);
+}
+
+DISAS_INSN(exg_aa)
+{
+ /* exchange Dx and Dy */
+ do_exg(DREG(insn, 9), DREG(insn, 0));
+}
+
+DISAS_INSN(exg_dd)
+{
+ /* exchange Ax and Ay */
+ do_exg(AREG(insn, 9), AREG(insn, 0));
+}
+
+DISAS_INSN(exg_da)
+{
+ /* exchange Dx and Ay */
+ do_exg(DREG(insn, 9), AREG(insn, 0));
+}
+
DISAS_INSN(and)
{
TCGv src;
@@ -3154,6 +3181,9 @@ void register_m68k_insns (CPUM68KState *env)
INSN(cmpa, b0c0, f0c0, M68000);
INSN(eor, b180, f1c0, CF_ISA_A);
BASE(and, c000, f000);
+ INSN(exg_dd, c140, f1f8, M68000);
+ INSN(exg_aa, c148, f1f8, M68000);
+ INSN(exg_da, c188, f1f8, M68000);
BASE(mulw, c0c0, f0c0);
BASE(addsub, d000, f000);
INSN(addx, d180, f1f8, CF_ISA_A);
--
2.7.4
next prev parent reply other threads:[~2016-10-27 0:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 0:42 [Qemu-devel] [PATCH v2 00/17] 680x0 instruction set, part 1 Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 01/17] target-m68k: add bkpt instruction Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 02/17] target-m68k: add linkl Laurent Vivier
2016-10-27 0:42 ` Laurent Vivier [this message]
2016-10-27 1:36 ` [Qemu-devel] [PATCH v2 03/17] target-m68k: add exg ops Richard Henderson
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 04/17] target-m68k: add addressing modes to scc Laurent Vivier
2016-10-27 1:38 ` Richard Henderson
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 05/17] target-m68k: add dbcc Laurent Vivier
2016-10-27 1:40 ` Richard Henderson
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 06/17] target-m68k: Inline addx, subx, negx Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 07/17] target-m68k: add addressing modes to not Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 08/17] target-m68k: eor can manage word and byte operands Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 09/17] target-m68k: or " Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 10/17] target-m68k: and " Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 11/17] target-m68k: suba/adda can manage word operand Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 12/17] target-m68k: some bit ops cleanup Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 13/17] target-m68k: introduce byte and word cc_ops Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 14/17] target-m68k: add addressing modes to neg Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 15/17] target-m68k: add/sub manage word and byte operands Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 16/17] target-m68k: cmp manages word and bytes operands Laurent Vivier
2016-10-27 0:42 ` [Qemu-devel] [PATCH v2 17/17] target-m68k: immediate ops manage word and byte operands Laurent Vivier
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=1477528950-8115-4-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 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).