qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com, mark.cave-ayland@ilande.co.uk,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	rth@twiddle.net
Subject: [Qemu-devel] [PATCH v2] target-sparc64: implement Short Floating-Point Store Instructions
Date: Tue, 12 Aug 2014 22:02:13 +0200	[thread overview]
Message-ID: <b6d3df1d58146c11a4cda9a002f99d224813b2f6.1407873114.git.atar4qemu@gmail.com> (raw)

Implement Short Floating-Point Store Instructions as described
in the chapter 13.5.2 of UltraSPARC-IIi User's Manual.

Particularly this instructions are used by NetBSD 4.0.1+ /sparc64

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
With this patch applied on top of cmd646 patches it's possible to install
and boot NetBSD 6.1.4 /sparc64.

Changes from v0: corrected the comment messages, it's store, not load.

 target-sparc/ldst_helper.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c
index 03bd9f9..736d953 100644
--- a/target-sparc/ldst_helper.c
+++ b/target-sparc/ldst_helper.c
@@ -2154,7 +2154,6 @@ void helper_stf_asi(CPUSPARCState *env, target_ulong addr, int asi, int size,
     unsigned int i;
     target_ulong val;
 
-    helper_check_align(env, addr, 3);
     addr = asi_address_mask(env, asi, addr);
 
     switch (asi) {
@@ -2192,7 +2191,21 @@ void helper_stf_asi(CPUSPARCState *env, target_ulong addr, int asi, int size,
         }
 
         return;
+    case 0xd2: /* 16-bit floating point store primary */
+    case 0xd3: /* 16-bit floating point store secondary */
+    case 0xda: /* 16-bit floating point store primary, LE */
+    case 0xdb: /* 16-bit floating point store secondary, LE */
+        helper_check_align(env, addr, 1);
+        /* Fall through */
+    case 0xd0: /* 8-bit floating point store primary */
+    case 0xd1: /* 8-bit floating point store secondary */
+    case 0xd8: /* 8-bit floating point store primary, LE */
+    case 0xd9: /* 8-bit floating point store secondary, LE */
+        val = env->fpr[rd/2].l.lower;
+        helper_st_asi(env, addr, val, asi & 0x8d, ((asi & 2) >> 1) + 1);
+        return;
     default:
+        helper_check_align(env, addr, 3);
         break;
     }
 
-- 
1.8.3.1

             reply	other threads:[~2014-08-12 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 20:02 Artyom Tarasenko [this message]
2014-08-13 16:38 ` [Qemu-devel] [PATCH v2] target-sparc64: implement Short Floating-Point Store Instructions Richard Henderson
2014-08-17 12:50   ` Mark Cave-Ayland

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=b6d3df1d58146c11a4cda9a002f99d224813b2f6.1407873114.git.atar4qemu@gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).