All of lore.kernel.org
 help / color / mirror / Atom feed
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 03/16] target-m68k: add exg ops
Date: Wed, 26 Oct 2016 18:35:53 +0200	[thread overview]
Message-ID: <1477499766-11722-4-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1477499766-11722-1-git-send-email-laurent@vivier.eu>

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target-m68k/translate.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 0d3111d..a07b6f5 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -2021,6 +2021,41 @@ DISAS_INSN(eor)
     DEST_EA(env, insn, OS_LONG, dest, &addr);
 }
 
+DISAS_INSN(exg)
+{
+    TCGv src;
+    TCGv reg;
+    TCGv dest;
+    int exg_mode;
+
+    exg_mode = insn & 0x1f8;
+
+    dest = tcg_temp_new();
+    switch (exg_mode) {
+    case 0x140:
+        /* exchange Dx and Dy */
+        src = DREG(insn, 9);
+        reg = DREG(insn, 0);
+        break;
+    case 0x148:
+        /* exchange Ax and Ay */
+        src = AREG(insn, 9);
+        reg = AREG(insn, 0);
+        break;
+    case 0x188:
+        /* exchange Dx and Ay */
+        src = DREG(insn, 9);
+        reg = AREG(insn, 0);
+        break;
+    default:
+        g_assert_not_reached();
+    }
+    tcg_gen_mov_i32(dest, src);
+    tcg_gen_mov_i32(src, reg);
+    tcg_gen_mov_i32(reg, dest);
+    tcg_temp_free(dest);
+}
+
 DISAS_INSN(and)
 {
     TCGv src;
@@ -3154,6 +3189,12 @@ void register_m68k_insns (CPUM68KState *env)
     INSN(cmpa,      b0c0, f0c0, M68000);
     INSN(eor,       b180, f1c0, CF_ISA_A);
     BASE(and,       c000, f000);
+    INSN(undef,     c140, f1f8, CF_ISA_A);
+    INSN(exg,       c140, f1f8, M68000);
+    INSN(undef,     c148, f1f8, CF_ISA_A);
+    INSN(exg,       c148, f1f8, M68000);
+    INSN(undef,     c188, f1f8, CF_ISA_A);
+    INSN(exg,       c188, f1f8, M68000);
     BASE(mulw,      c0c0, f0c0);
     BASE(addsub,    d000, f000);
     INSN(addx,      d180, f1f8, CF_ISA_A);
-- 
2.7.4

  parent reply	other threads:[~2016-10-26 16:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 16:35 [Qemu-devel] [PATCH 00/16] 680x0 instruction set, part 1 Laurent Vivier
2016-10-26 16:35 ` [Qemu-devel] [PATCH 01/16] target-m68k: add bkpt instruction Laurent Vivier
2016-10-26 21:38   ` Richard Henderson
2016-10-26 16:35 ` [Qemu-devel] [PATCH 02/16] target-m68k: add linkl Laurent Vivier
2016-10-26 16:35 ` Laurent Vivier [this message]
2016-10-26 22:07   ` [Qemu-devel] [PATCH 03/16] target-m68k: add exg ops Richard Henderson
2016-10-26 16:35 ` [Qemu-devel] [PATCH 04/16] target-m68k: add scc/dbcc Laurent Vivier
2016-10-26 22:12   ` Richard Henderson
2016-10-26 16:35 ` [Qemu-devel] [PATCH 05/16] target-m68k: Inline addx, subx, negx Laurent Vivier
2016-10-26 16:35 ` [Qemu-devel] [PATCH 06/16] target-m68k: add addressing modes to not Laurent Vivier
2016-10-26 16:35 ` [Qemu-devel] [PATCH 07/16] target-m68k: eor can manage word and byte operands Laurent Vivier
2016-10-26 16:35 ` [Qemu-devel] [PATCH 08/16] target-m68k: or " Laurent Vivier
2016-10-26 16:35 ` [Qemu-devel] [PATCH 09/16] target-m68k: and " Laurent Vivier
2016-10-26 16:36 ` [Qemu-devel] [PATCH 10/16] target-m68k: suba/adda can manage word operand Laurent Vivier
2016-10-26 16:36 ` [Qemu-devel] [PATCH 11/16] target-m68k: some bit ops cleanup Laurent Vivier
2016-10-26 16:36 ` [Qemu-devel] [PATCH 12/16] target-m68k: introduce byte and word cc_ops Laurent Vivier
2016-10-26 22:26   ` Richard Henderson
2016-10-26 16:36 ` [Qemu-devel] [PATCH 13/16] target-m68k: add addressing modes to neg Laurent Vivier
2016-10-26 16:36 ` [Qemu-devel] [PATCH 14/16] target-m68k: add/sub manage word and byte operands Laurent Vivier
2016-10-26 16:36 ` [Qemu-devel] [PATCH 15/16] target-m68k: cmp manages word and bytes operands Laurent Vivier
2016-10-26 16:36 ` [Qemu-devel] [PATCH 16/16] 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=1477499766-11722-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 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.