qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH 1/3] m68k: allow fpu to manage double single data type.
Date: Sun, 31 May 2009 02:50:19 +0200	[thread overview]
Message-ID: <1243731021-23692-2-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1243731021-23692-1-git-send-email-laurent@vivier.eu>

This patch allows to manage instructions like "fcmpd #2.2, %fp0".
Original function manages only data accessed through an address register.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target-m68k/translate.c |   71 +++++++++++++++++++++++++----------------------
 1 files changed, 38 insertions(+), 33 deletions(-)

diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index ea6b34b..223b296 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -3115,40 +3115,45 @@ DISAS_INSN(fpu)
             goto undef;
         }
         if (opsize == OS_DOUBLE) {
-            tmp32 = tcg_temp_new_i32();
-            tcg_gen_mov_i32(tmp32, AREG(insn, 0));
-            switch ((insn >> 3) & 7) {
-            case 2:
-            case 3:
-                break;
-            case 4:
-                tcg_gen_addi_i32(tmp32, tmp32, -8);
-                break;
-            case 5:
-                offset = ldsw_code(s->pc);
-                s->pc += 2;
-                tcg_gen_addi_i32(tmp32, tmp32, offset);
-                break;
-            case 7:
-                offset = ldsw_code(s->pc);
-                offset += s->pc - 2;
-                s->pc += 2;
-                tcg_gen_addi_i32(tmp32, tmp32, offset);
-                break;
-            default:
-                goto undef;
-            }
-            src = gen_load64(s, tmp32);
-            switch ((insn >> 3) & 7) {
-            case 3:
-                tcg_gen_addi_i32(tmp32, tmp32, 8);
-                tcg_gen_mov_i32(AREG(insn, 0), tmp32);
-                break;
-            case 4:
-                tcg_gen_mov_i32(AREG(insn, 0), tmp32);
-                break;
+            if ((insn & 7) == 4) {
+                src = gen_load64(s, tcg_const_i32(s->pc));
+                s->pc += 8;
+            } else {
+                tmp32 = tcg_temp_new_i32();
+                tcg_gen_mov_i32(tmp32, AREG(insn, 0));
+                switch ((insn >> 3) & 7) {
+                case 2:
+                case 3:
+                    break;
+                case 4:
+                    tcg_gen_addi_i32(tmp32, tmp32, -8);
+                    break;
+                case 5:
+                    offset = ldsw_code(s->pc);
+                    s->pc += 2;
+                    tcg_gen_addi_i32(tmp32, tmp32, offset);
+                    break;
+                case 7:
+                    offset = ldsw_code(s->pc);
+                    offset += s->pc - 2;
+                    s->pc += 2;
+                    tcg_gen_addi_i32(tmp32, tmp32, offset);
+                    break;
+                default:
+                    goto undef;
+                }
+                src = gen_load64(s, tmp32);
+                switch ((insn >> 3) & 7) {
+                case 3:
+                    tcg_gen_addi_i32(tmp32, tmp32, 8);
+                    tcg_gen_mov_i32(AREG(insn, 0), tmp32);
+                    break;
+                case 4:
+                    tcg_gen_mov_i32(AREG(insn, 0), tmp32);
+                    break;
+                }
+                tcg_temp_free_i32(tmp32);
             }
-            tcg_temp_free_i32(tmp32);
         } else {
             SRC_EA(tmp32, opsize, 1, NULL);
             src = tcg_temp_new_i64();
-- 
1.5.6.5

  reply	other threads:[~2009-05-31  0:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31  0:50 [Qemu-devel] [PATCH 0/3] m68k: Some FPU enhancements Laurent Vivier
2009-05-31  0:50 ` Laurent Vivier [this message]
2009-05-31  0:50   ` [Qemu-devel] [PATCH 2/3] m68k: add FScc instruction Laurent Vivier
2009-05-31  0:50     ` [Qemu-devel] [PATCH 3/3] m68k: add single data type to gen_ea Laurent Vivier
2009-05-31 12:03   ` [Qemu-devel] Re: [PATCH 1/3] m68k: allow fpu to manage double single data type Andreas Schwab
2009-05-31 12:57     ` 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=1243731021-23692-2-git-send-email-laurent@vivier.eu \
    --to=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).