qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH v2 3/8] target-mips: generate a reserved instruction exception on CPU without DSP
Date: Wed,  9 Jan 2013 16:27:40 +0100	[thread overview]
Message-ID: <1357745265-16084-4-git-send-email-aurelien@aurel32.net> (raw)
In-Reply-To: <1357745265-16084-1-git-send-email-aurelien@aurel32.net>

On CPU without DSP ASE support, a reserved instruction exception (instead of
a DSP ASE sate disabled) should be generated.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 33d04fb..2c238ef 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -1394,14 +1394,22 @@ static inline void check_cp1_registers(DisasContext *ctx, int regs)
 static inline void check_dsp(DisasContext *ctx)
 {
     if (unlikely(!(ctx->hflags & MIPS_HFLAG_DSP))) {
-        generate_exception(ctx, EXCP_DSPDIS);
+        if (ctx->insn_flags & ASE_DSP) {
+            generate_exception(ctx, EXCP_DSPDIS);
+        } else {
+            generate_exception(ctx, EXCP_RI);
+        }
     }
 }
 
 static inline void check_dspr2(DisasContext *ctx)
 {
     if (unlikely(!(ctx->hflags & MIPS_HFLAG_DSPR2))) {
-        generate_exception(ctx, EXCP_DSPDIS);
+        if (ctx->insn_flags & ASE_DSP) {
+            generate_exception(ctx, EXCP_DSPDIS);
+        } else {
+            generate_exception(ctx, EXCP_RI);
+        }
     }
 }
 
-- 
1.7.10.4

  parent reply	other threads:[~2013-01-09 15:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 15:27 [Qemu-devel] [PATCH v2 0/8] target-mips: DSP ASE fixes and cleanup Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 1/8] target-mips: fix DSP loads with rd = 0 Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 2/8] target-mips: copy insn_flags in DisasContext Aurelien Jarno
2013-01-09 15:27 ` Aurelien Jarno [this message]
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 4/8] target-mips: add unions to access DSP elements Aurelien Jarno
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 5/8] target-mips: use DSP unions for binary DSP operators Aurelien Jarno
2013-01-09 21:16   ` Blue Swirl
2013-01-10  7:08     ` Aurelien Jarno
2013-01-12 10:39       ` Blue Swirl
2013-01-12 14:34         ` Aurelien Jarno
2013-01-12 15:08           ` Blue Swirl
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 6/8] target-mips: use DSP unions for unary " Aurelien Jarno
2013-01-09 21:17   ` Blue Swirl
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 7/8] target-mips: use DSP unions for reduction add instructions Aurelien Jarno
2013-01-09 21:18   ` Blue Swirl
2013-01-09 15:27 ` [Qemu-devel] [PATCH v2 8/8] target-mips: implement DSP (d)append sub-class with TCG Aurelien Jarno
2013-01-09 18:51 ` [Qemu-devel] [PATCH v2 0/8] target-mips: DSP ASE fixes and cleanup Richard Henderson
2013-01-09 21:19 ` Blue Swirl

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=1357745265-16084-4-git-send-email-aurelien@aurel32.net \
    --to=aurelien@aurel32.net \
    --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).