Test/fix pabsh, pabsw, psrlvw.
authorAndrew Cagney <cagney@redhat.com>
Mon, 1 Sep 1997 09:47:03 +0000 (09:47 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 1 Sep 1997 09:47:03 +0000 (09:47 +0000)
14 files changed:
sim/ChangeLog
sim/configure
sim/configure.in
sim/mips/ChangeLog
sim/mips/gencode.c
sim/testsuite/ChangeLog [new file with mode: 0644]
sim/testsuite/configure.in
sim/testsuite/mips64vr5900el-elf/.Sanitize
sim/testsuite/mips64vr5900el-elf/ChangeLog
sim/testsuite/mips64vr5900el-elf/Makefile.in
sim/testsuite/mips64vr5900el-elf/t-macros.i
sim/testsuite/mips64vr5900el-elf/t-pabsh.s [new file with mode: 0644]
sim/testsuite/mips64vr5900el-elf/t-pabsw.s [new file with mode: 0644]
sim/testsuite/mips64vr5900el-elf/t-psrlvw.s [new file with mode: 0644]

index 5aebd7077b1beed2c8b38d21b317e13f10168377..4d1d20b5007787eb9ebdf33fce8bf35ac863ea03 100644 (file)
@@ -1,3 +1,8 @@
+Mon Sep  1 16:48:23 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * configure.in (testdir): When a testsuite directory, add that to
+       the list of confdirs.
+
 Tue Aug 19 11:17:46 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * configure.in (extra_subdirs): Enable igen ready for V850.
index 72b7ac6b464805ce4b1ac7acfe0e369042021093..1aea8939c7628a00c08961f8d19d6b5afbb62ced 100755 (executable)
@@ -1288,7 +1288,7 @@ case "${target}" in
   d30v-*-*)
        sim_target=d30v
        only_if_gcc=yes
-       extra_subdirs="${extra_subdirs} igen testsuite"
+       extra_subdirs="${extra_subdirs} igen"
        ;;
 # end-sanitize-d30v
   h8300*-*-*)          sim_target=h8300 ;;
@@ -1343,7 +1343,6 @@ case "${target}" in
   v850eq-*-*)
        # The V850 simulator can only be compiled by gcc.
        sim_target=v850
-       extra_subdirs="${extra_subdirs} igen"
        only_if_gcc=yes
        ;;
 # end-sanitize-v850eq
@@ -1367,6 +1366,14 @@ case "${target}" in
   *)                   sim_target=none ;;
 esac
 
+
+# Is there a testsuite directory for the target?
+testdir=`echo ${target} | sed -e 's/-.*-/-/'`
+if test -r ${srcdir}/testsuite/${testdir}/configure ; then
+  extra_subdirs="${extra_subdirs} testsuite"
+fi
+
+
 case "${enable_sim}" in
 no)    sim_target=none ;;
 yes)
index 99f4aed6317ca020029754293b09245072784962..0d4e8003b9cce1de304f34dc0bf6f935e3bd77bb 100644 (file)
@@ -53,7 +53,7 @@ case "${target}" in
   d30v-*-*)
        sim_target=d30v
        only_if_gcc=yes
-       extra_subdirs="${extra_subdirs} igen testsuite"
+       extra_subdirs="${extra_subdirs} igen"
        ;;
 # end-sanitize-d30v
   h8300*-*-*)          sim_target=h8300 ;;
@@ -131,6 +131,14 @@ case "${target}" in
   *)                   sim_target=none ;;
 esac
 
+
+# Is there a testsuite directory for the target?
+testdir=`echo ${target} | sed -e 's/-.*-/-/'`
+if test -r ${srcdir}/testsuite/${testdir}/configure ; then
+  extra_subdirs="${extra_subdirs} testsuite"
+fi
+
+
 case "${enable_sim}" in
 no)    sim_target=none ;;
 yes)
index 037e1df08021e1571777e6b8823077ce7b193419..8831969b0ac56441a62c348cb181fa7546432e06 100644 (file)
@@ -1,3 +1,11 @@
+start-sanitize-r5900
+Mon Sep  1 18:43:30 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * gencode.c (build_instruction): For "pabsw" and "pabsh", check
+       for overflow due to ABS of MININT, set result to MAXINT.
+       (build_instruction): For "psrlvw", signextend bit 31.
+
+end-sanitize-r5900
 Wed Aug 27 18:13:22 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index 6ef01bf3a9ea87b5cd804d3e48baa607968be734..4c6937d9f77768a3e0702015af3b80ab673d5510 100644 (file)
@@ -3580,8 +3580,8 @@ build_instruction (doisa, features, mips16, insn)
      break;
 
     case PSRLVW:
-     printf("GPR_UD(destreg,0) = RT_UW(0) >> (RS_UB(0) & 0x1F);\n");
-     printf("GPR_UD(destreg,1) = RT_UW(2) >> (RS_UB(8) & 0x1F);\n");
+     printf("GPR_UD(destreg,0) = SIGNEXTEND ( RT_UW(0) >> (RS_UB(0) & 0x1F), 31);\n");
+     printf("GPR_UD(destreg,1) = SIGNEXTEND ( RT_UW(2) >> (RS_UB(8) & 0x1F), 31);\n");
      break;
 
     case PSRAVW:
@@ -3658,14 +3658,18 @@ build_instruction (doisa, features, mips16, insn)
      {
        char* name = name_for_data_len( insn );
        char* letter = letter_for_data_len( insn );
+       char* min = min_for_data_len( insn );
+       char* max = max_for_data_len( insn );
 
        printf("int i;\n");
        printf("for(i=0;i<%sS_IN_MMI_REGS;i++)\n", name );
        printf("  {\n");
-       printf("  if (RT_S%s(i) < 0)\n", letter );
-       printf("    GPR_S%s(destreg,i) = -RT_S%s(i);\n", letter, letter );
-       printf("  else\n");
+       printf("  if (RT_S%s(i) >= 0)\n", letter );
        printf("    GPR_S%s(destreg,i) =  RT_S%s(i);\n", letter, letter );
+       printf("  else if (RT_S%s(i) == %s)\n", letter, min );
+       printf("    GPR_S%s(destreg,i) = %s;\n", letter, max );
+       printf("  else\n");
+       printf("    GPR_S%s(destreg,i) = -RT_S%s(i);\n", letter, letter );
        printf("  }\n");
        break;
      }
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
new file mode 100644 (file)
index 0000000..736aacc
--- /dev/null
@@ -0,0 +1,13 @@
+Mon Sep  1 16:43:55 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * configure.in (configdirs): Test for the target directory instead
+       of matching on a target.
+
+end-sanitize-r5900
+Tue Jul 15 13:43:20 1997  Andrew Cagney  <cagney@sendai.cygnus.com>
+
+       * configure.in (configdirs): Configure mipsr5900rv5900el
+       directory.
+       * configure: Regenerate.
+
+start-sanitize-r5900
index 37371bd873e3c9b81f8e35ab2fb7dee16d5d1d64..7c1b73ee79d4c13c52a77373f1adc9f729f6aa32 100644 (file)
@@ -5,8 +5,7 @@ dnl script appropriate for this directory.  For more information, check
 dnl any existing configure script.
 
 AC_PREREQ(2.5)
-dnl FIXME - think of a truly uniq file to this directory
-AC_INIT(d30v-elf)
+AC_INIT(common/bits-tst.c)
 
 CC=${CC-cc}
 AC_SUBST(CC)
@@ -16,17 +15,11 @@ AC_CANONICAL_SYSTEM
 # Directories to use in all configurations.
 configdirs=""
 
-
 # add test sub-directory for appropriate targets
-case "${target}" in
-# start-sanitize-d30v
-       d30v-*-elf)             configdirs="${configdirs} d30v-elf" ;;
-# end-sanitize-d30v
-# start-sanitize-r5900
-       mips64vr5900el-*-elf)   configdirs="${configdirs} mips64vr5900el-elf" ;;
-# end-sanitize-r5900
-       *)              ;;
-esac
+testdir=`echo ${target} | sed -e 's/-.*-/-/'`
+if test -r ${srcdir}/${testdir}/configure ; then
+  configdirs="${configdirs} $testdir"
+fi
 
 # configure the subdirectories too
 AC_CONFIG_SUBDIRS($configdirs)
index 06716fc28f7556278483634377c0961b81321c89..7f83da87bc9ccbb90ecc62697d8268e5d02738ee 100644 (file)
@@ -31,6 +31,10 @@ exit47.s
 hello.s
 loop.s
 t-macros.i
+
+t-mtsa.s
+t-pabsh.s
+t-pabsw.s
 t-paddb.s
 t-paddsb.s
 t-paddsh.s
@@ -75,6 +79,7 @@ t-ppacw.s
 t-prot3w.s
 t-psllvw.s
 t-psravw.s
+t-psrlvw.s
 t-psubsb.s
 t-psubsh.s
 t-psubsw.s
@@ -83,6 +88,7 @@ t-psubuh.s
 t-psubuw.s
 t-psubw.s
 t-qfsrv.s
+
 tick.s
 
 Things-to-lose:
index 444ff9a866f0d68690f157336a000b55b8857295..4381f1346d7dcd8c86530388be361bba3bc0ccaa 100644 (file)
@@ -1,3 +1,11 @@
+Mon Sep  1 16:58:13 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * Makefile.in (TESTS): Add t-psrlvw, t-pabsh, t-pabsw.
+       (.s.o, .o.tx59): Add -Ttext 0xa002000, to ld.  Add -I <srcdir> to
+       as.
+
+       t-psrlvw.s, t-pabsh, t-pabsw: New files.
+
 Tue Jul 29 10:56:53 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * t-mtsa.s: Check move/from SA instructions.
index 849efb3d10f85b2694ce28bdc47d17a74a50fca8..704b77d688e68df48fd7eb491ef4bb4c00b76547 100644 (file)
@@ -72,8 +72,8 @@ LD_FOR_TARGET = `\
   fi`
 
 RUN_FOR_TARGET = `\
-  if [ -x ../../../sim/${target_cpu}/run ]; then \
-    echo ../../../sim/${target_cpu}/run ; \
+  if [ -x ../../../sim/mips/run ]; then \
+    echo ../../../sim/mips/run ; \
   else \
     echo $(target_alias)-run ; \
   fi`
@@ -83,6 +83,8 @@ TESTS = \
        exit47.ko \
        \
        t-mtsa.ok \
+       t-pabsh.ok \
+       t-pabsw.ok \
        t-paddb.ok \
        t-paddsb.ok \
        t-paddsh.ok \
@@ -126,6 +128,7 @@ TESTS = \
        t-ppacw.ok \
        t-prot3w.ok \
        t-psllvw.ok \
+       t-psrlvw.ok \
        t-psravw.ok \
        t-psubsb.ok \
        t-psubsh.ok \
@@ -154,7 +157,7 @@ sanity:
 
 # Rules for running the tests
 
-.SUFFIXES: .u .ok .tx59 .hi .ko
+.SUFFIXES: .u .uue .ok .ok .tx59 .hi .ko .ko
 .tx59.ok:
        rm -f tmp-$* $*.hi
        ulimit -t 5 ; $(RUN_FOR_TARGET) $*.tx59 > tmp-$*
@@ -179,20 +182,15 @@ sanity:
 # Rules for building all the tests and packing them into
 # uuencoded files.
 
-
-.SUFFIXES: .u .S .tx59
-.S.u:
-       rm -f $*.o $*.tx59
-       $(AS_FOR_TARGET) $(srcdir)/$*.S -o $*.o
-       $(LD_FOR_TARGET) -o $* $*.o
-       uuencode < $* $* > $*.u
-       rm -f $*.o $*
-.S.tx59:
-       rm -f $*.o $*.tx59
-       $(AS_FOR_TARGET) $(srcdir)/$*.S -o $*.o
-       $(LD_FOR_TARGET) -o $*.tx59 $*.o
-       rm -f $*.o $*
-
+.tx59.u:
+       uuencode < $*.tx59 $*.tx59 > $*.u
+       @echo "Move $*.u $*.uue"
+.uue.tx59:
+       uudecode $(srcdir)/$*.uue
+.o.tx59:
+       $(LD_FOR_TARGET) -Ttext 0xa0020000 -o $*.tx59 $*.o
+.s.o:
+       $(AS_FOR_TARGET) -I $(srcdir) $(srcdir)/$*.s -o $*.o
 
 
 #
index 47844a7ef0c02945c52add260265ef97e9c782fa..51297812f8778a50ae0dd097d788784ddf3c5013 100644 (file)
@@ -95,6 +95,7 @@
        .endm
 
        .macro start
+       .text
        .globl _start
        .set noreorder
 _start:
diff --git a/sim/testsuite/mips64vr5900el-elf/t-pabsh.s b/sim/testsuite/mips64vr5900el-elf/t-pabsh.s
new file mode 100644 (file)
index 0000000..0d29843
--- /dev/null
@@ -0,0 +1,10 @@
+.include "t-macros.i"
+
+       start
+
+       load $8 0x8000800080008000 0xffffffffffffffff
+test_pabsh:
+       pabsh $10, $8
+       check10 0x7fff7fff7fff7fff 0x0001000100010001
+
+       exit0
diff --git a/sim/testsuite/mips64vr5900el-elf/t-pabsw.s b/sim/testsuite/mips64vr5900el-elf/t-pabsw.s
new file mode 100644 (file)
index 0000000..18a02da
--- /dev/null
@@ -0,0 +1,10 @@
+.include "t-macros.i"
+
+       start
+
+       load $8 0x8000000080000000 0xffffffffffffffff
+test_pabsw:
+       pabsw $10, $8
+       check10 0x7fffffff7fffffff 0x0000000100000001
+
+       exit0
diff --git a/sim/testsuite/mips64vr5900el-elf/t-psrlvw.s b/sim/testsuite/mips64vr5900el-elf/t-psrlvw.s
new file mode 100644 (file)
index 0000000..c3e8597
--- /dev/null
@@ -0,0 +1,11 @@
+.include "t-macros.i"
+
+       start
+
+        load $8 0x00ff0000ffff0000 0x0000ffffffff0000
+        load $9 0x00ff0000ffff0000 0x0000ffffffff0000
+test_psrlvw:   
+        psrlvw  $10,$8,$9       #Expectation:
+        check10 0xffffffffffff0000 0xffffffffffff0000
+
+       exit0
This page took 0.037663 seconds and 4 git commands to generate.