]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-06-03 Chris Demetriou <cgd@broadcom.com>
authorChris Demetriou <cgd@google.com>
Mon, 3 Jun 2002 21:00:29 +0000 (21:00 +0000)
committerChris Demetriou <cgd@google.com>
Mon, 3 Jun 2002 21:00:29 +0000 (21:00 +0000)
            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.

sim/mips/ChangeLog
sim/mips/Makefile.in
sim/mips/configure
sim/mips/configure.in
sim/mips/mdmx.c
sim/mips/mdmx.igen
sim/mips/mips.igen
sim/mips/sb1.igen [new file with mode: 0644]
sim/mips/sim-main.h

index 8e220c77a9c3730c5fa16948f9ed6a9ed4665a55..f2378637cb62b583ae22f070374b0356488913ef 100644 (file)
@@ -1,3 +1,21 @@
+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.
+
 2002-06-03  Chris Demetriou  <cgd@broadcom.com>
 
        * Makefile.in (IGEN_INCLUDE): Add mdmx.igen.
index b1d2ad76fe1e43209e699d7bc09f5ec8bd1b75d5..f4604c0d188af06bc14b381c6bb43206f9a8d018 100644 (file)
@@ -84,6 +84,7 @@ M16_DC=$(srcdir)/m16.dc
 IGEN_INCLUDE=\
        $(srcdir)/m16.igen \
        $(srcdir)/mdmx.igen \
+       $(srcdir)/sb1.igen \
        $(srcdir)/tx.igen \
        $(srcdir)/vr.igen \
 
index e5f427e10f770b9995a512fa36321f981c469b37..2a9d8b9bf576d01abbcae31bb9bc6f4ba8bfd4fa 100755 (executable)
@@ -4023,6 +4023,10 @@ case "${target}" in
                        sim_igen_machine="-M mips32"
                        sim_igen_filter="32,f"
                        ;;
+  mipsisa64sb1*-*-*)   sim_gen=IGEN
+                       sim_igen_machine="-M mips64,sb1"
+                       sim_igen_filter="32,64,f"
+                       ;;
   mipsisa64*-*-*)      sim_gen=IGEN
                        sim_igen_machine="-M mips64"
                        sim_igen_filter="32,64,f"
@@ -4132,7 +4136,7 @@ esac
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:4136: checking for X" >&5
+echo "configure:4140: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4194,12 +4198,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4198 "configure"
+#line 4202 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4268,14 +4272,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4272 "configure"
+#line 4276 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -4368,17 +4372,17 @@ for ac_hdr in string.h strings.h stdlib.h stdlib.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4372: checking for $ac_hdr" >&5
+echo "configure:4376: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4377 "configure"
+#line 4381 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4405,7 +4409,7 @@ fi
 done
 
 echo $ac_n "checking for fabs in -lm""... $ac_c" 1>&6
-echo "configure:4409: checking for fabs in -lm" >&5
+echo "configure:4413: checking for fabs in -lm" >&5
 ac_lib_var=`echo m'_'fabs | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4413,7 +4417,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4417 "configure"
+#line 4421 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4424,7 +4428,7 @@ int main() {
 fabs()
 ; return 0; }
 EOF
-if { (eval echo configure:4428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4454,12 +4458,12 @@ fi
 for ac_func in aint anint sqrt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4458: checking for $ac_func" >&5
+echo "configure:4462: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4463 "configure"
+#line 4467 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4482,7 +4486,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
index d8c402326953afb9abe693c9425c64f1214e0b84..bb713085e66194307cbfdd4bba5e6c189a9916b4 100644 (file)
@@ -128,6 +128,10 @@ case "${target}" in
                        sim_igen_machine="-M mips32"
                        sim_igen_filter="32,f"
                        ;;
+  mipsisa64sb1*-*-*)   sim_gen=IGEN
+                       sim_igen_machine="-M mips64,sb1"
+                       sim_igen_filter="32,64,f"
+                       ;;
   mipsisa64*-*-*)      sim_gen=IGEN
                        sim_igen_machine="-M mips64"
                        sim_igen_filter="32,64,f"
index 2b0892288c96c936b48e4934319ccd36dba28db0..96abe1ddc123b42812ee00b70be31a4db2c387ea 100644 (file)
@@ -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
 };
 
 
index ddc075c6aea1d8854b33b1f2fa95eb1a80938d41..f286e3b4ab4a7a5c336d16b0a5daf0f967e752b5 100644 (file)
 //  Similarly, for the single-bit fields which differentiate between
 //  formats (FMTOP), 0 is OB format and 1 is QH format.
 
+//  If you change this file to add instructions, please make sure that model
+//  "sb1" configurations still build, and that you've added no new
+//  instructions to the "sb1" model.
+
 
 // Helper:
 //
@@ -93,6 +97,7 @@
 
 :%s::::FMTSEL:int fmtsel
 *mdmx:
+*sb1:
 {
   if ((fmtsel & 0x1) == 0)
     return "ob";
 
 :%s::::FMTOP:int fmtop
 *mdmx:
+*sb1:
 {
   switch (fmtop)
     {
 
 :%s::::SHOP:int shop
 *mdmx:
+*sb1:
 {
   if ((shop & 0x11) == 0x00)
     switch ((shop >> 1) & 0x07)
 011110,5.FMTSEL,5.VT,5.VS,5.VD,001011:MDMX:64::ADD.fmt
 "add.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,0,0000,110111:MDMX:64::ADDA.fmt
 "adda.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,1,0000,110111:MDMX:64::ADDL.fmt
 "addl.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,00,3.IMM,5.VT,5.VS,5.VD,0110,1.FMTOP,0:MDMX:64::ALNI.fmt
 "alni.%s<FMTOP> v<VD>, v<VS>, v<VT>, <IMM>"
 *mdmx:
+*sb1:
 {
   unsigned64 result;
   int s;
 011110,5.RS,5.VT,5.VS,5.VD,0110,1.FMTOP,1:MDMX:64::ALNV.fmt
 "alnv.%s<FMTOP> v<VD>, v<VS>, v<VT>, r<RS>"
 *mdmx:
+*sb1:
 {
   unsigned64 result;
   int s;
 011110,5.FMTSEL,5.VT,5.VS,5.VD,001100:MDMX:64::AND.fmt
 "and.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,00000,000001:MDMX:64::C.EQ.fmt
 "c.eq.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,00000,000101:MDMX:64::C.LE.fmt
 "c.le.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,00000,000100:MDMX:64::C.LT.fmt
 "c.lt.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,000111:MDMX:64::MAX.fmt
 "max.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,000110:MDMX:64::MIN.fmt
 "min.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,110000:MDMX:64::MUL.fmt
 "mul.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,0,0000,110011:MDMX:64::MULA.fmt
 "mula.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,1,0000,110011:MDMX:64::MULL.fmt
 "mull.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,0,0000,110010:MDMX:64::MULS.fmt
 "muls.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,1,0000,110010:MDMX:64::MULSL.fmt
 "mulsl.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,001111:MDMX:64::NOR.fmt
 "nor.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,001110:MDMX:64::OR.fmt
 "or.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,000010:MDMX:64::PICKF.fmt
 "pickf.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,000011:MDMX:64::PICKT.fmt
 "pickt.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,1000,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACH.fmt
 "rach.%s<FMTOP> v<VD>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   check_mdmx_fmtop (SD_, instruction_0, FMTOP);
 011110,0000,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACL.fmt
 "racl.%s<FMTOP> v<VD>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   check_mdmx_fmtop (SD_, instruction_0, FMTOP);
 011110,0100,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACM.fmt
 "racm.%s<FMTOP> v<VD>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   check_mdmx_fmtop (SD_, instruction_0, FMTOP);
 011110,5.FMTSEL,5.VT,00000,5.VD,100001:MDMX:64::RNAU.fmt
 "rnau.%s<FMTSEL> v<VD>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,00000,5.VD,100010:MDMX:64::RNEU.fmt
 "rneu.%s<FMTSEL> v<VD>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,00000,5.VD,100000:MDMX:64::RZU.fmt
 "rzu.%s<FMTSEL> v<VD>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.SHOP,5.VT,5.VS,5.VD,011111:MDMX:64::SHFL.op.fmt
 "shfl.%s<SHOP> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, SHOP))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,010000:MDMX:64::SLL.fmt
 "sll.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,010010:MDMX:64::SRL.fmt
 "srl.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,5.VD,001010:MDMX:64::SUB.fmt
 "sub.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,0,0000,110110:MDMX:64::SUBA.fmt
 "suba.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,5.FMTSEL,5.VT,5.VS,1,0000,110110:MDMX:64::SUBL.fmt
 "subl.%s<FMTSEL> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
 011110,1000,1.FMTOP,00000,5.VS,00000,111110:MDMX:64::WACH.fmt
 "wach.%s<FMTOP> v<VS>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   check_mdmx_fmtop (SD_, instruction_0, FMTOP);
 011110,0000,1.FMTOP,5.VT,5.VS,00000,111110:MDMX:64::WACL.fmt
 "wacl.%s<FMTOP> v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   check_mdmx_fmtop (SD_, instruction_0, FMTOP);
 011110,5.FMTSEL,5.VT,5.VS,5.VD,001101:MDMX:64::XOR.fmt
 "xor.%s<FMTSEL> v<VD>, v<VS>, v<VT>"
 *mdmx:
+*sb1:
 {
   check_mdmx (SD_, instruction_0);
   if (check_mdmx_fmtsel (SD_, instruction_0, FMTSEL))
index 5416f068228a5fef20be12cb586eca87111710e7..b282602b143456229e1f5197dfee44088088a95d 100644 (file)
 :model:::mips16:mips16:                        // m16.igen (and m16.dc)
 :model:::mdmx:mdmx:                    // mdmx.igen
 
+//  Vendor Extensions
+//
+//  Instructions specific to these extensions are in separate .igen files.
+//  Extensions add instructions on to a base ISA.
+:model:::sb1:sb1:                      // sb1.igen
+
 
 // Pseudo instructions known by IGEN
 :internal::::illegal:
 \f
 :include:::m16.igen
 :include:::mdmx.igen
+:include:::sb1.igen
 :include:::tx.igen
 :include:::vr.igen
 \f
diff --git a/sim/mips/sb1.igen b/sim/mips/sb1.igen
new file mode 100644 (file)
index 0000000..6453670
--- /dev/null
@@ -0,0 +1,191 @@
+// -*- C -*-
+
+// Simulator definition for the Broadcom SiByte SB-1 CPU extensions.
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Broadcom Corporation (SiByte).
+//
+// This file is part of GDB, the GNU debugger.
+// 
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+// 
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+//  MDMX ASE Instructions
+//  ---------------------
+//
+//  The SB-1 implements the format OB subset of MDMX
+//  and has three additions (pavg, pabsdiff, pabsdifc).
+//  In addition, there are a couple of partial-decoding
+//  issues for the read/write accumulator instructions.
+//
+//  This code is structured so that mdmx.igen can be used by
+//  selecting the allowed instructions either via model, or by
+//  using check_mdmx_fmtsel and check_mdmx_fmtop to cause an
+//  exception if the instruction is not allowed.
+
+
+:function:::void:check_mdmx:instruction_word insn
+*sb1:
+{
+  if (!COP_Usable(1))
+    SignalExceptionCoProcessorUnusable(1);
+  if ((SR & status_MX) == 0)
+    SignalExceptionMDMX();
+  check_u64 (SD_, insn);
+}
+
+:function:::int:check_mdmx_fmtsel:instruction_word insn, int fmtsel
+*sb1:
+{
+  switch (fmtsel & 0x03)
+    {
+    case 0x00:     /* ob */
+    case 0x02:
+      return 1;
+    case 0x01:     /* qh */
+    case 0x03:     /* UNPREDICTABLE */
+      SignalException (ReservedInstruction, insn);
+      return 0;
+    }
+  return 0;
+}
+
+:function:::int:check_mdmx_fmtop:instruction_word insn, int fmtop
+*sb1:
+{
+  switch (fmtop & 0x01)
+    {
+    case 0x00:     /* ob */
+      return 1;
+    case 0x01:     /* qh */
+      SignalException (ReservedInstruction, insn);
+      return 0;
+    }
+  return 0;
+}
+
+
+011110,10,2.X!0,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACH.sb1.fmt
+"rach.?<X>.%s<FMTOP> v<VD>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,00,2.X!0,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACL.sb1.fmt
+"racl.?<X>.%s<FMTOP> v<VD>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,01,2.X!0,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RACM.sb1.fmt
+"racm.?<X>.%s<FMTOP> v<VD>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,2.X1!0!1!2,2.X2,1.FMTOP,00000,00000,5.VD,111111:MDMX:64::RAC.sb1.fmt
+"rac?<X1>.?<X2> v<VD>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,10,2.X!0,1.FMTOP,00000,5.VS,00000,111110:MDMX:64::WACH.sb1.fmt
+"wach.?<X>.%s<FMTOP> v<VS>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,00,2.X!0,1.FMTOP,5.VT,5.VS,00000,111110:MDMX:64::WACL.sb1.fmt
+"wacl.?<X>.%s<FMTOP> v<VS>,v<VT>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,2.X1!0!2,2.X2,1.FMTOP,5.VT,5.VS,00000,111110:MDMX:64::WAC.sb1.fmt
+"wacl?<X1>.?<X2>.%s<FMTOP> v<VS>,v<VT>"
+*sb1:
+{
+  check_mdmx (SD_, instruction_0);
+  check_mdmx_fmtop (SD_, instruction_0, FMTOP);
+  /* No op.  */
+}
+
+
+011110,5.FMTSEL,5.VT,5.VS,5.VD,001001:MDMX:64::PABSDIFF.fmt
+"pabsdiff.%s<FMTSEL> v<VD>,v<VS>,v<VT>"
+*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);
+}
+
+
+011110,5.FMTSEL,5.VT,5.VS,00000,110101:MDMX:64::PABSDIFC.fmt
+"pabsdifc.%<FMTSEL> v<VS>,v<VT>"
+*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);
+}
+
+
+011110,5.FMTSEL,5.VT,5.VS,5.VD,001000:MDMX:64::PAVG.fmt
+"pavg.%s<FMTSEL> v<VD>,v<VS>,v<VT>"
+*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);
+}
index 08d2e608b4e7d707aea75ffb7e6edbc6092e316c..462606ec951754678e291ec4349f272ffc87c2ea 100644 (file)
@@ -567,6 +567,8 @@ struct sim_state {
 #define status_CU1       (1 << 29)      /* Coprocessor 1 usable */
 #define status_CU2       (1 << 30)      /* Coprocessor 2 usable */
 #define status_CU3       (1 << 31)      /* Coprocessor 3 usable */
+/* Bits reserved for implementations:  */
+#define status_SBX       (1 << 16)      /* Enable SiByte SB-1 extensions.  */
 
 #define cause_BD ((unsigned)1 << 31)    /* L1 Exception in branch delay slot */
 #define cause_BD2         (1 << 30)     /* L2 Exception in branch delay slot */
@@ -743,7 +745,6 @@ typedef unsigned int MX_fmtsel;   /* MDMX format select field (5 bits).  */
 #define MX_VECT_XOR  (3)
 #define MX_VECT_SLL  (4)
 #define MX_VECT_SRL  (5)
-
 #define MX_VECT_ADD  (6)
 #define MX_VECT_SUB  (7)
 #define MX_VECT_MIN  (8)
@@ -751,6 +752,8 @@ typedef unsigned int MX_fmtsel;   /* MDMX format select field (5 bits).  */
 #define MX_VECT_MUL  (10)
 #define MX_VECT_MSGN (11)
 #define MX_VECT_SRA  (12)
+#define MX_VECT_ABSD (13)              /* SB-1 only.  */
+#define MX_VECT_AVG  (14)              /* SB-1 only.  */
 
 unsigned64 mdmx_cpr_op (SIM_STATE, int op, unsigned64 op1, int vt, MX_fmtsel fmtsel);
 #define MX_Add(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_ADD, op1, vt, fmtsel)
@@ -766,6 +769,8 @@ unsigned64 mdmx_cpr_op (SIM_STATE, int op, unsigned64 op1, int vt, MX_fmtsel fmt
 #define MX_ShiftRightLogical(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_SRL, op1, vt, fmtsel)
 #define MX_Sub(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_SUB, op1, vt, fmtsel)
 #define MX_Xor(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_XOR, op1, vt, fmtsel)
+#define MX_AbsDiff(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_ABSD, op1, vt, fmtsel)
+#define MX_Avg(op1,vt,fmtsel) mdmx_cpr_op(SIM_ARGS, MX_VECT_AVG, op1, vt, fmtsel)
 
 #define MX_C_EQ  0x1
 #define MX_C_LT  0x4
@@ -784,6 +789,7 @@ unsigned64 mdmx_pick_op (SIM_STATE, int tf, unsigned64 op1, int vt, MX_fmtsel fm
 #define MX_VECT_MULSL (5)
 #define MX_VECT_SUBA  (6)
 #define MX_VECT_SUBL  (7)
+#define MX_VECT_ABSDA (8)              /* SB-1 only.  */
 
 void mdmx_acc_op (SIM_STATE, int op, unsigned64 op1, int vt, MX_fmtsel fmtsel);
 #define MX_AddA(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_ADDA, op1, vt, fmtsel)
@@ -794,6 +800,7 @@ void mdmx_acc_op (SIM_STATE, int op, unsigned64 op1, int vt, MX_fmtsel fmtsel);
 #define MX_MulSL(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_MULSL, op1, vt, fmtsel)
 #define MX_SubA(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_SUBA, op1, vt, fmtsel)
 #define MX_SubL(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_SUBL, op1, vt, fmtsel)
+#define MX_AbsDiffC(op1,vt,fmtsel) mdmx_acc_op(SIM_ARGS, MX_VECT_ABSDA, op1, vt, fmtsel)
 
 #define MX_FMT_OB   (0)
 #define MX_FMT_QH   (1)