aboutsummaryrefslogtreecommitdiff
path: root/sim/mips/mdmx.c
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2002-06-03 21:00:29 +0000
committerChris Demetriou <cgd@google.com>2002-06-03 21:00:29 +0000
commit7cbea0890ed72ea3c56a8c8abe4824c020c87295 (patch)
treef44c290f3d5f7d5e9179632c7e6d73f473514ad5 /sim/mips/mdmx.c
parentcf6fb9ce2fde099451fa0b0c59318b24784ada0b (diff)
downloadgdb-7cbea0890ed72ea3c56a8c8abe4824c020c87295.zip
gdb-7cbea0890ed72ea3c56a8c8abe4824c020c87295.tar.gz
gdb-7cbea0890ed72ea3c56a8c8abe4824c020c87295.tar.bz2
2002-06-03 Chris Demetriou <cgd@broadcom.com>
Ed Satterthwaite <ehs@broadcom.com> * configure.in (mipsisa64sb1*-*-*): New target for supporting Broadcom SiByte SB-1 processor configurations. * configure: Regenerate. * sb1.igen: New file. * mips.igen: Include sb1.igen. (sb1): New model. * Makefile.in (IGEN_INCLUDE): Add sb1.igen. * mdmx.igen: Add "sb1" model to all appropriate functions and instructions. * mdmx.c (AbsDiffOB, AvgOB, AccAbsDiffOB): New functions. (ob_func, ob_acc): Reference the above. (qh_acc): Adjust to keep the same size as ob_acc. * sim-main.h (status_SBX, MX_VECT_ABSD, MX_VECT_AVG, MX_AbsDiff) (MX_Avg, MX_VECT_ABSDA, MX_AbsDiffC): New macros.
Diffstat (limited to 'sim/mips/mdmx.c')
-rw-r--r--sim/mips/mdmx.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/sim/mips/mdmx.c b/sim/mips/mdmx.c
index 2b08922..96abe1d 100644
--- a/sim/mips/mdmx.c
+++ b/sim/mips/mdmx.c
@@ -250,7 +250,6 @@ MsgnQH(signed16 ts, signed16 tt)
return t;
}
-
static signed16
SRAQH(signed16 ts, signed16 tt)
{
@@ -259,6 +258,21 @@ SRAQH(signed16 ts, signed16 tt)
}
+/* "pabsdiff" and "pavg" are defined only for OB format. */
+
+static unsigned8
+AbsDiffOB(unsigned8 ts, unsigned8 tt)
+{
+ return (ts >= tt ? ts - tt : tt - ts);
+}
+
+static unsigned8
+AvgOB(unsigned8 ts, unsigned8 tt)
+{
+ return ((unsigned32)ts + (unsigned32)tt + 1) >> 1;
+}
+
+
/* Dispatch tables for operations that update a CPR. */
static const QH_FUNC qh_func[] = {
@@ -270,7 +284,7 @@ static const QH_FUNC qh_func[] = {
static const OB_FUNC ob_func[] = {
AndOB, NorOB, OrOB, XorOB, SLLOB, SRLOB,
AddOB, SubOB, MinOB, MaxOB,
- MulOB, NULL, NULL, NULL, NULL
+ MulOB, NULL, NULL, AbsDiffOB, AvgOB
};
/* Auxiliary functions for CPR updates. */
@@ -743,17 +757,26 @@ AccSubLOB(signed24 *a, unsigned8 ts, unsigned8 tt)
*a = (signed24)ts - (signed24)tt;
}
+static void
+AccAbsDiffOB(signed24 *a, unsigned8 ts, unsigned8 tt)
+{
+ unsigned8 t = (ts >= tt ? ts - tt : tt - ts);
+ *a += (signed24)t;
+}
+
/* Dispatch tables for operations that update a CPR. */
static const QH_ACC qh_acc[] = {
AccAddAQH, AccAddAQH, AccMulAQH, AccMulLQH,
- SubMulAQH, SubMulLQH, AccSubAQH, AccSubLQH
+ SubMulAQH, SubMulLQH, AccSubAQH, AccSubLQH,
+ NULL
};
static const OB_ACC ob_acc[] = {
AccAddAOB, AccAddLOB, AccMulAOB, AccMulLOB,
- SubMulAOB, SubMulLOB, AccSubAOB, AccSubLOB
+ SubMulAOB, SubMulLOB, AccSubAOB, AccSubLOB,
+ AccAbsDiffOB
};