qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tsuneo Saito <tsnsaito@gmail.com>
To: qemu-devel@nongnu.org
Cc: Tsuneo Saito <tsnsaito@gmail.com>
Subject: [Qemu-devel] [PATCH 3/4] SPARC64: Implement stfa/stdfa/stqfa instrcutions properly
Date: Wed, 13 Jul 2011 12:30:48 +0900	[thread overview]
Message-ID: <1310527849-784-4-git-send-email-tsnsaito@gmail.com> (raw)
In-Reply-To: <1310527849-784-1-git-send-email-tsnsaito@gmail.com>

This patch implements sparcv9 stfa/stdfa/stqfa instructions
with non block-store ASIs.

Signed-off-by: Tsuneo Saito <tsnsaito@gmail.com>
---
 target-sparc/op_helper.c |   15 +++++++++++----
 target-sparc/translate.c |    2 --
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index a75ac4f..fe71829 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -3396,6 +3396,7 @@ void helper_stf_asi(target_ulong addr, int asi, int size, int rd)
 {
     unsigned int i;
     target_ulong val = 0;
+    CPU_DoubleU u;
 
     helper_check_align(addr, 3);
     addr = asi_address_mask(env, asi, addr);
@@ -3440,16 +3441,22 @@ void helper_stf_asi(target_ulong addr, int asi, int size, int rd)
     switch(size) {
     default:
     case 4:
-        val = *((uint32_t *)&env->fpr[rd]);
+        helper_st_asi(addr, *(uint32_t *)&env->fpr[rd], asi, size);
         break;
     case 8:
-        val = *((int64_t *)&DT0);
+        u.l.upper = *(uint32_t *)&env->fpr[rd++];
+        u.l.lower = *(uint32_t *)&env->fpr[rd++];
+        helper_st_asi(addr, u.ll, asi, size);
         break;
     case 16:
-        // XXX
+        u.l.upper = *(uint32_t *)&env->fpr[rd++];
+        u.l.lower = *(uint32_t *)&env->fpr[rd++];
+        helper_st_asi(addr, u.ll, asi, 8);
+        u.l.upper = *(uint32_t *)&env->fpr[rd++];
+        u.l.lower = *(uint32_t *)&env->fpr[rd++];
+        helper_st_asi(addr + 8, u.ll, asi, 8);
         break;
     }
-    helper_st_asi(addr, val, asi, size);
 }
 
 target_ulong helper_cas_asi(target_ulong addr, target_ulong val1,
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index d07eb25..95e78a3 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -4739,12 +4739,10 @@ static void disas_sparc_insn(DisasContext * dc)
                         r_const = tcg_const_i32(7);
                         gen_helper_check_align(cpu_addr, r_const);
                         tcg_temp_free_i32(r_const);
-                        gen_op_load_fpr_QT0(QFPREG(rd));
                         gen_stf_asi(cpu_addr, insn, 16, QFPREG(rd));
                     }
                     break;
                 case 0x37: /* V9 stdfa */
-                    gen_op_load_fpr_DT0(DFPREG(rd));
                     gen_stf_asi(cpu_addr, insn, 8, DFPREG(rd));
                     break;
                 case 0x3c: /* V9 casa */
-- 
1.7.5.4

  parent reply	other threads:[~2011-07-13  3:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13  3:30 [Qemu-devel] [PATCH 0/4] SPARC64: Implement sparcv9 ldfa/stfa instructions Tsuneo Saito
2011-07-13  3:30 ` [Qemu-devel] [PATCH 1/4] SPARC64: Implement ldfa/lddfa/ldqfa instructions properly Tsuneo Saito
2011-07-13 16:27   ` Blue Swirl
2011-07-13 18:02     ` Artyom Tarasenko
2011-07-13 18:19       ` Blue Swirl
2011-07-13 22:56         ` tsnsaito
2011-07-13  3:30 ` [Qemu-devel] [PATCH 2/4] SPARC64: fp_disabled checks on ldfa/lddfa/ldqfa Tsuneo Saito
2011-07-13  3:30 ` Tsuneo Saito [this message]
2011-07-13  3:30 ` [Qemu-devel] [PATCH 4/4] SPARC64: fp_disabled checks on stfa/stdfa/stqfa Tsuneo Saito
2011-07-13  8:57 ` [Qemu-devel] [PATCH 0/4] SPARC64: Implement sparcv9 ldfa/stfa instructions Artyom Tarasenko
2011-07-13 11:06   ` tsnsaito
2011-07-13 12:09     ` Mark Cave-Ayland
2011-07-13 12:48       ` tsnsaito
2011-07-13 16:34         ` Blue Swirl
2011-07-14  3:13           ` tsnsaito
2011-07-14  7:38             ` Artyom Tarasenko
2011-07-14  9:13               ` tsnsaito
2011-07-14 15:31                 ` Blue Swirl
2011-07-15  1:55                   ` tsnsaito

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=1310527849-784-4-git-send-email-tsnsaito@gmail.com \
    --to=tsnsaito@gmail.com \
    --cc=qemu-devel@nongnu.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).