qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [SH4] Implement MOVUA.L.
Date: Sun, 12 Oct 2008 19:43:34 +0400	[thread overview]
Message-ID: <200810121943.34699.vladimir@codesourcery.com> (raw)


SH4A has the new MOVUA.L instruction, capable of accessing non-aligned
32-bit data. This patch makes qemu handle it. To the best of my knowledge,
from qemu standpoint this is just like ordinary move, no special handling
for non-alignment is necessary.

- Volodya

	* target-sh4/translate.c (_decode_opc): Implement
	MOVUA.L.
---
 target-sh4/translate.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index f279980..43963a8 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -1520,6 +1520,18 @@ void _decode_opc(DisasContext * ctx)
     case 0x00c3:		/* movca.l R0,@Rm */
 	tcg_gen_qemu_st32(REG(0), REG(B11_8), ctx->memidx);
 	return;
+    case 0x40a9:
+        /* MOVUA.L @Rm,R0 (Rm) -> R0
+	   Load non-boundary-aligned data */
+        tcg_gen_qemu_ld32u(REG(0), REG(B11_8), ctx->memidx);
+        return;
+     case 0x40e9:
+        /* MOVUA.L @Rm+,R0   (Rm) -> R0, Rm + 4 -> Rm
+                Load non-boundary-aligned
+                data */
+        tcg_gen_qemu_ld32u(REG(0), REG(B11_8), ctx->memidx);
+	tcg_gen_addi_i32(REG(B11_8), REG(B11_8), 4);
+	return;
     case 0x0029:		/* movt Rn */
 	tcg_gen_andi_i32(REG(B11_8), cpu_sr, SR_T);
 	return;
-- 
1.5.3.5

             reply	other threads:[~2008-10-12 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-12 15:43 Vladimir Prus [this message]
2008-10-12 23:32 ` [Qemu-devel] [SH4] Implement MOVUA.L Aurelien Jarno

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=200810121943.34699.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.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).