Fix stdfq op (Aurelien Jarno)
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 5 Apr 2007 18:12:08 +0000 (18:12 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 5 Apr 2007 18:12:08 +0000 (18:12 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2604 c046a42c-6fe2-441c-8c8c-71466251a162

target-sparc/cpu.h
target-sparc/translate.c

index 3279cfd..7233b8b 100644 (file)
 #define FSR_FTT_MASK (FSR_FTT2 | FSR_FTT1 | FSR_FTT0)
 #define FSR_FTT_IEEE_EXCP (1 << 14)
 #define FSR_FTT_UNIMPFPOP (3 << 14)
+#define FSR_FTT_SEQ_ERROR (4 << 14)
 #define FSR_FTT_INVAL_FPR (6 << 14)
 
 #define FSR_FCC1  (1<<11)
@@ -239,7 +240,7 @@ typedef struct CPUSPARCState {
 #else
 #define GET_FSR32(env) (env->fsr)
 #define PUT_FSR32(env, val) do { uint32_t _tmp = val;                   \
-        env->fsr = (_tmp & 0xcfc1ffff) | (env->fsr & 0x000e0000);       \
+        env->fsr = (_tmp & 0xcfc1dfff) | (env->fsr & 0x000e0000);       \
     } while (0)
 #endif
 
index 53a3a67..cb11b92 100644 (file)
@@ -2602,8 +2602,14 @@ static void disas_sparc_insn(DisasContext * dc)
                    gen_op_stfsr();
                    gen_op_ldst(stf);
                    break;
+#if !defined(CONFIG_USER_ONLY)
                case 0x26: /* stdfq */
-                   goto nfpu_insn;
+                   if (!supervisor(dc))
+                       goto priv_insn;
+                   if (gen_trap_ifnofpu(dc))
+                       goto jmp_insn;
+                   goto nfq_insn;
+#endif
                case 0x27:
                     gen_op_load_fpr_DT0(DFPREG(rd));
                    gen_op_ldst(stdf);
@@ -2675,6 +2681,13 @@ static void disas_sparc_insn(DisasContext * dc)
     gen_op_fpexception_im(FSR_FTT_UNIMPFPOP);
     dc->is_br = 1;
     return;
+#if !defined(CONFIG_USER_ONLY)
+ nfq_insn:
+    save_state(dc);
+    gen_op_fpexception_im(FSR_FTT_SEQ_ERROR);
+    dc->is_br = 1;
+    return;
+#endif
 #ifndef TARGET_SPARC64
  ncp_insn:
     save_state(dc);