Merge zizzer:/bk/newmem
[gem5.git] / src / arch / sparc / isa / base.isa
index b78511398a338a11880f2808e7d4032208d8eba4..58a17f23e5245ba65d3efcab90594e73c0a5ff0e 100644 (file)
@@ -416,3 +416,27 @@ output decoder {{
         }
 }};
 
+output exec {{
+    /// Check "FP enabled" machine status bit.  Called when executing any FP
+    /// instruction in full-system mode.
+    /// @retval Full-system mode: NoFault if FP is enabled, FpDisabled
+    /// if not.  Non-full-system mode: always returns NoFault.
+#if FULL_SYSTEM
+    inline Fault checkFpEnableFault(%(CPU_exec_context)s *xc)
+    {
+        Fault fault = NoFault; // dummy... this ipr access should not fault
+        if (xc->readMiscRegWithEffect(MISCREG_PSTATE) & PSTATE::pef &&
+            xc->readMiscRegWithEffect(MISCREG_FPRS) & 0x4)
+            return NoFault;
+        else
+            return new FpDisabled;
+    }
+#else
+    inline Fault checkFpEnableFault(%(CPU_exec_context)s *xc)
+    {
+        return NoFault;
+    }
+#endif
+}};
+
+