This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[applied mips sim patch] check SB-1 SBX bit w/ helper function.


Checked by building/running sb1-elf... not that anything in there will
actually test it.  8-)


chris
--
2004-04-09  Chris Demetriou  <cgd@broadcom.com>

	* sb1.igen (check_sbx): New function.
	(PABSDIFF.fmt, PABSDIFC.fmt, PAVG.fmt): Use check_sbx.

Index: sb1.igen
===================================================================
RCS file: /cvs/src/src/sim/mips/sb1.igen,v
retrieving revision 1.2
diff -u -p -r1.2 sb1.igen
--- sb1.igen	2 May 2003 22:17:21 -0000	1.2
+++ sb1.igen	10 Apr 2004 06:17:40 -0000
@@ -22,6 +22,20 @@
 // 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
 //  ---------------------
 //
@@ -152,13 +166,9 @@
 *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));
 }
 
 
@@ -167,13 +177,9 @@
 *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);
 }
 
 
@@ -182,11 +188,7 @@
 *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));
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]