]> Git Repo - qemu.git/commitdiff
target-mips: generate a reserved instruction exception on CPU without DSP
authorAurelien Jarno <[email protected]>
Tue, 1 Jan 2013 17:02:23 +0000 (18:02 +0100)
committerAurelien Jarno <[email protected]>
Thu, 31 Jan 2013 22:29:36 +0000 (23:29 +0100)
On CPU without DSP ASE support, a reserved instruction exception (instead of
a DSP ASE sate disabled) should be generated.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
target-mips/translate.c

index aad5ae4b1431be06fe301d890ef6a5db62fb6410..99f3492de250e9237e5f2ce5177b848b625283a0 100644 (file)
@@ -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);
+        }
     }
 }
 
This page took 0.0325 seconds and 4 git commands to generate.