aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2004-04-10 06:17:55 +0000
committerChris Demetriou <cgd@google.com>2004-04-10 06:17:55 +0000
commitc6f9085cab2e8b38e5319021a42f9c540e23d12f (patch)
treedcefee1a8d7e175addf6e6d3a6eb93b630cdbb0a /sim
parentccba17639bb5ce87551ac901354c19c7bdf31a3b (diff)
downloadgdb-c6f9085cab2e8b38e5319021a42f9c540e23d12f.zip
gdb-c6f9085cab2e8b38e5319021a42f9c540e23d12f.tar.gz
gdb-c6f9085cab2e8b38e5319021a42f9c540e23d12f.tar.bz2
2004-04-09 Chris Demetriou <cgd@broadcom.com>
* sb1.igen (check_sbx): New function. (PABSDIFF.fmt, PABSDIFC.fmt, PAVG.fmt): Use check_sbx.
Diffstat (limited to 'sim')
-rw-r--r--sim/mips/ChangeLog5
-rw-r--r--sim/mips/sb1.igen44
2 files changed, 28 insertions, 21 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index be4ce2a..a91b137 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -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>
diff --git a/sim/mips/sb1.igen b/sim/mips/sb1.igen
index 33c5141..7a718c7 100644
--- a/sim/mips/sb1.igen
+++ b/sim/mips/sb1.igen
@@ -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));
}