2004-04-09 Chris Demetriou <cgd@broadcom.com>
authorChris Demetriou <cgd@google.com>
Sat, 10 Apr 2004 06:17:55 +0000 (06:17 +0000)
committerChris Demetriou <cgd@google.com>
Sat, 10 Apr 2004 06:17:55 +0000 (06:17 +0000)
        * sb1.igen (check_sbx): New function.
        (PABSDIFF.fmt, PABSDIFC.fmt, PAVG.fmt): Use check_sbx.

sim/mips/ChangeLog
sim/mips/sb1.igen

index be4ce2ac24ad755fe43d88decbe88532b2c0649c..a91b13725d8eeafdcd7105ff7fe2e94d3cda246a 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-09  Chris Demetriou  <cgd@broadcom.com>
+
+       * sb1.igen (check_sbx): New function.
+       (PABSDIFF.fmt, PABSDIFC.fmt, PAVG.fmt): Use check_sbx.
+
 2004-03-29  Chris Demetriou  <cgd@broadcom.com>
            Richard Sandiford  <rsandifo@redhat.com>
 
index 33c5141e776475b9aaa5feeb9f8ce887142b83f2..7a718c736be44390ba2eb4678770bef131d596f4 100644 (file)
 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
+// Helper:
+//
+// Check that the SB-1 extension instruction can currently be used, and
+// signal a ReservedInstruction exception if not.
+//
+
+:function:::void:check_sbx:instruction_word insn
+*sb1:
+{
+  if ((SR & status_SBX) == 0)
+    SignalException(ReservedInstruction, insn);
+}
+
+
 //  MDMX ASE Instructions
 //  ---------------------
 //
 *sb1:
 {
   check_mdmx (SD_, instruction_0);
-  if (SR & status_SBX)
-    {
-      check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
-      StoreFPR(VD,fmt_mdmx,MX_AbsDiff(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
-    }
-  else
-    SignalException(ReservedInstruction, instruction_0);
+  check_sbx (SD_, instruction_0);
+  check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
+  StoreFPR(VD,fmt_mdmx,MX_AbsDiff(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
 }
 
 
 *sb1:
 {
   check_mdmx (SD_, instruction_0);
-  if (SR & status_SBX)
-    {
-      check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
-      MX_AbsDiffC(ValueFPR(VS,fmt_mdmx),VT,FMTSEL);
-    }
-  else
-    SignalException(ReservedInstruction, instruction_0);
+  check_sbx (SD_, instruction_0);
+  check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
+  MX_AbsDiffC(ValueFPR(VS,fmt_mdmx),VT,FMTSEL);
 }
 
 
 *sb1:
 {
   check_mdmx (SD_, instruction_0);
-  if (SR & status_SBX)
-    {
-      check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
-      StoreFPR(VD,fmt_mdmx,MX_Avg(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
-    }
-  else
-    SignalException(ReservedInstruction, instruction_0);
+  check_sbx (SD_, instruction_0);
+  check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
+  StoreFPR(VD,fmt_mdmx,MX_Avg(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
 }