]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix sign extension on 32 bit add/sub instructions.
authorAndrew Cagney <cagney@redhat.com>
Thu, 21 May 1998 09:32:07 +0000 (09:32 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 21 May 1998 09:32:07 +0000 (09:32 +0000)
sim/mips/ChangeLog
sim/mips/mips.igen
sim/mn10300/ChangeLog
sim/mn10300/dv-mn103cpu.c
sim/mn10300/dv-mn103int.c
sim/testsuite/mips64r5900-elf/ChangeLog
sim/testsuite/mips64r5900-elf/Makefile.in [new file with mode: 0644]
sim/testsuite/mips64r5900-elf/t-sub.s [new file with mode: 0644]

index 2afcd498ceae6d10df74c6498ba9c73f9fbca453..ca50e3607f53d6b3ce8458ca84ef899de02e7777 100644 (file)
@@ -1,3 +1,8 @@
+Thu May 21 18:57:19 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * sim-main.h (ALU32_END): Sign extend 32 bit results.
+       * mips.igen (ADD, SUB, ADDI, DADD, DSUB): Trace.
+       
 start-sanitize-r5900
 Thu May 21 17:15:39 1998  Andrew Cagney  <cagney@b1.cygnus.com>
 
index a1f254c629b4ea5088c5b19f16726643c1dea8d0..df89140dd9b7f959232b8b116eb99dc4c537084d 100644 (file)
 *tx19:
 // end-sanitize-tx19
 {
-  ALU32_BEGIN (GPR[RS]);
-  ALU32_ADD (GPR[RT]);
-  ALU32_END (GPR[RD]);
+  TRACE_ALU_INPUT2 (GPR[RS], GPR[RT]);
+  {
+    ALU32_BEGIN (GPR[RS]);
+    ALU32_ADD (GPR[RT]);
+    ALU32_END (GPR[RD]);
+  }
+  TRACE_ALU_RESULT (GPR[RD]);
 }
 
 
 *tx19:
 // end-sanitize-tx19
 {
-  ALU32_BEGIN (GPR[RS]);
-  ALU32_ADD (EXTEND16 (IMMEDIATE));
-  ALU32_END (GPR[RT]);
+  TRACE_ALU_INPUT2 (GPR[RS], EXTEND16 (IMMEDIATE));
+  {
+    ALU32_BEGIN (GPR[RS]);
+    ALU32_ADD (EXTEND16 (IMMEDIATE));
+    ALU32_END (GPR[RT]);
+  }
+  TRACE_ALU_RESULT (GPR[RT]);
 }
 
 
 // end-sanitize-tx19
 {
   /* this check's for overflow */
-  ALU64_BEGIN (GPR[RS]);
-  ALU64_ADD (GPR[RT]);
-  ALU64_END (GPR[RD]);
+  TRACE_ALU_INPUT2 (GPR[RS], GPR[RT]);
+  {
+    ALU64_BEGIN (GPR[RS]);
+    ALU64_ADD (GPR[RT]);
+    ALU64_END (GPR[RD]);
+  }
+  TRACE_ALU_RESULT (GPR[RD]);
 }
 
 
 *tx19:
 // end-sanitize-tx19
 {
-  ALU64_BEGIN (GPR[RS]);
-  ALU64_ADD (EXTEND16 (IMMEDIATE));
-  ALU64_END (GPR[RT]);
+  TRACE_ALU_INPUT2 (GPR[RS], EXTEND16 (IMMEDIATE));
+  {
+    ALU64_BEGIN (GPR[RS]);
+    ALU64_ADD (EXTEND16 (IMMEDIATE));
+    ALU64_END (GPR[RT]);
+  }
+  TRACE_ALU_RESULT (GPR[RT]);
 }
 
 
 *tx19:
 // end-sanitize-tx19
 {
-  ALU64_BEGIN (GPR[RS]);
-  ALU64_SUB (GPR[RT]);
-  ALU64_END (GPR[RD]);
+  TRACE_ALU_INPUT2 (GPR[RS], GPR[RT]);
+  {
+    ALU64_BEGIN (GPR[RS]);
+    ALU64_SUB (GPR[RT]);
+    ALU64_END (GPR[RD]);
+  }
+  TRACE_ALU_RESULT (GPR[RD]);
 }
 
 
 *tx19:
 // end-sanitize-tx19
 {
-  ALU32_BEGIN (GPR[RS]);
-  ALU32_SUB (GPR[RT]);
-  ALU32_END (GPR[RD]);
+  TRACE_ALU_INPUT2 (GPR[RS], GPR[RT]);
+  {
+    ALU32_BEGIN (GPR[RS]);
+    ALU32_SUB (GPR[RT]);
+    ALU32_END (GPR[RD]);
+  }
+  TRACE_ALU_RESULT (GPR[RD]);
 }
 
 
index 71d8149e8107865ac230e3cda1a8aa79cf777961..20eab2860f6469effbdede4ca8a423a80ac8fa72 100644 (file)
@@ -1,3 +1,28 @@
+start-sanitize-am30
+Thu May 14 19:30:11 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * dv-mn103cpu.c: Use struct hw_event.
+       * dv-mn103cpu.c, dv-mn103int.c: Don't include hw-base.h, include
+       hw-main.h
+       * dv-mn103cpu.c, dv-mn103int.c: Rename *_callback to *_method.
+
+Wed May  6 13:29:06 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * interp.c (sim_open): Create a polling PAL device.
+
+end-sanitize-am30
+Fri May  1 16:39:15 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * dv-mn103int.c (mn103int_port_event): 
+       (mn103int_port_event): 
+       (mn103int_io_read_buffer): 
+       (mn103int_io_write_buffer): 
+
+       * dv-mn103cpu.c (deliver_mn103cpu_interrupt): Drop CPU/CIA args.
+       (mn103cpu_port_event): Ditto.
+       (mn103cpu_io_read_buffer): Ditto.
+       (mn103cpu_io_write_buffer): Ditto.
+
 Tue Apr 28 18:33:31 1998  Geoffrey Noer  <noer@cygnus.com>
 
         * configure: Regenerated to track ../common/aclocal.m4 changes.
index 89b60b83053bc418227d6c80113fc43760c31c27..431c2bb2a7e2c87a37a1fd824bdd7be59ce40d5c 100644 (file)
@@ -21,7 +21,7 @@
 
 
 #include "sim-main.h"
-#include "hw-base.h"
+#include "hw-main.h"
 
 /* DEVICE
 
@@ -107,7 +107,7 @@ struct mn103cpu_block {
 
 struct mn103cpu {
   struct mn103cpu_block block;
-  hw_event *pending_handler;
+  struct hw_event *pending_handler;
   int pending_level;
   int pending_nmi;
   int pending_reset;
@@ -151,9 +151,9 @@ static const struct hw_port_descriptor mn103cpu_ports[] = {
 /* Finish off the partially created hw device.  Attach our local
    callbacks.  Wire up our port names etc */
 
-static hw_io_read_buffer_callback mn103cpu_io_read_buffer;
-static hw_io_write_buffer_callback mn103cpu_io_write_buffer;
-static hw_port_event_callback mn103cpu_port_event;
+static hw_io_read_buffer_method mn103cpu_io_read_buffer;
+static hw_io_write_buffer_method mn103cpu_io_write_buffer;
+static hw_port_event_method mn103cpu_port_event;
 
 static void
 attach_mn103cpu_regs (struct hw *me,
@@ -228,7 +228,7 @@ deliver_mn103cpu_interrupt (struct hw *me,
   else if (controller->pending_nmi)
     {
       controller->pending_nmi = 0;
-      store_half (SP - 4, CIA_GET (cpu));
+      store_word (SP - 4, CIA_GET (cpu));
       store_half (SP - 8, PSW);
       PSW &= ~PSW_IE;
       SP = SP - 8;
@@ -241,7 +241,7 @@ deliver_mn103cpu_interrupt (struct hw *me,
     {
       /* Don't clear pending level.  Request continues to be pending
          until the interrupt controller clears/changes it */
-      store_half (SP - 4, CIA_GET (cpu));
+      store_word (SP - 4, CIA_GET (cpu));
       store_half (SP - 8, PSW);
       PSW &= ~PSW_IE;
       PSW &= ~PSW_LM;
@@ -249,7 +249,7 @@ deliver_mn103cpu_interrupt (struct hw *me,
       SP = SP - 8;
       CIA_SET (cpu, 0x40000000 + controller->interrupt_vector[controller->pending_level]);
       HW_TRACE ((me, "port-out ack %d", controller->pending_level));
-      hw_port_event (me, ACK_PORT, controller->pending_level, NULL, NULL_CIA);
+      hw_port_event (me, ACK_PORT, controller->pending_level);
       HW_TRACE ((me, "int level=%d pc=0x%08lx psw=0x%04x sp=0x%08lx",
                 controller->pending_level,
                 (long) CIA_GET (cpu), (unsigned) PSW, (long) SP));
@@ -278,9 +278,7 @@ mn103cpu_port_event (struct hw *me,
                     int my_port,
                     struct hw *source,
                     int source_port,
-                    int level,
-                    sim_cpu *processor,
-                    sim_cia cia)
+                    int level)
 {
   struct mn103cpu *controller = hw_data (me);
 
@@ -355,9 +353,7 @@ mn103cpu_io_read_buffer (struct hw *me,
                         void *dest,
                         int space,
                         unsigned_word base,
-                        unsigned nr_bytes,
-                        sim_cpu *processor,
-                        sim_cia cia)
+                        unsigned nr_bytes)
 {
   struct mn103cpu *controller = hw_data (me);
   unsigned16 val = 0;
@@ -396,9 +392,7 @@ mn103cpu_io_write_buffer (struct hw *me,
                          const void *source,
                          int space,
                          unsigned_word base,
-                         unsigned nr_bytes,
-                         sim_cpu *cpu,
-                         sim_cia cia)
+                         unsigned nr_bytes)
 {
   struct mn103cpu *controller = hw_data (me);
   unsigned16 val;
@@ -431,7 +425,7 @@ mn103cpu_io_write_buffer (struct hw *me,
 }     
 
 
-const struct hw_device_descriptor dv_mn103cpu_descriptor[] = {
+const struct hw_descriptor dv_mn103cpu_descriptor[] = {
   { "mn103cpu", mn103cpu_finish, },
   { NULL },
 };
index 270cbf5d3e0bf7cf387dbd1a7aadf044326c451e..f334d12373fb01907ca8397cbeaef657e90b154d 100644 (file)
@@ -20,8 +20,7 @@
     */
 
 
-#include "sim-main.h"
-#include "hw-base.h"
+#include "hw-main.h"
 
 /* DEVICE
 
@@ -303,9 +302,9 @@ static const struct hw_port_descriptor mn103int_ports[] = {
 /* Finish off the partially created hw device.  Attach our local
    callbacks.  Wire up our port names etc */
 
-static hw_io_read_buffer_callback mn103int_io_read_buffer;
-static hw_io_write_buffer_callback mn103int_io_write_buffer;
-static hw_port_event_callback mn103int_port_event;
+static hw_io_read_buffer_method mn103int_io_read_buffer;
+static hw_io_write_buffer_method mn103int_io_write_buffer;
+static hw_port_event_method mn103int_port_event;
 
 static void
 attach_mn103int_regs (struct hw *me,
@@ -388,7 +387,7 @@ find_highest_interrupt_group (struct hw *me,
   int selected;
 
   /* FIRST_NMI_GROUP (group zero) is used as a special default value
-     when searching for an interrupt group */
+     when searching for an interrupt group.*/
   selected = FIRST_NMI_GROUP; 
   controller->group[FIRST_NMI_GROUP].level = 7;
   
@@ -397,7 +396,8 @@ find_highest_interrupt_group (struct hw *me,
       struct mn103int_group *group = &controller->group[gid];
       if ((group->request & group->enable) != 0)
        {
-         if (group->level > controller->group[selected].level)
+         /* Remember, lower level, higher priority.  */
+         if (group->level < controller->group[selected].level)
            {
              selected = gid;
            }
@@ -416,7 +416,7 @@ push_interrupt_level (struct hw *me,
   int selected = find_highest_interrupt_group (me, controller);
   int level = controller->group[selected].level;
   HW_TRACE ((me, "port-out - selected=%d level=%d", selected, level));
-  hw_port_event (me, LEVEL_PORT, level, NULL, NULL_CIA);
+  hw_port_event (me, LEVEL_PORT, level);
 }
 
 
@@ -427,9 +427,7 @@ mn103int_port_event (struct hw *me,
                     int my_port,
                     struct hw *source,
                     int source_port,
-                    int level,
-                    sim_cpu *processor,
-                    sim_cia cia)
+                    int level)
 {
   struct mn103int *controller = hw_data (me);
 
@@ -493,7 +491,7 @@ mn103int_port_event (struct hw *me,
              if ((group->request & group->enable) != 0)
                {
                  HW_TRACE ((me, "port-out NMI"));
-                 hw_port_event (me, NMI_PORT, 1, NULL, NULL_CIA);
+                 hw_port_event (me, NMI_PORT, 1);
                }
              break;
            }
@@ -521,8 +519,8 @@ decode_group (struct hw *me,
              unsigned_word base,
              unsigned_word *offset)
 {
-  int gid = (base / 8) % NR_GROUPS;
-  *offset = (base % 8);
+  int gid = (base / 4) % NR_GROUPS;
+  *offset = (base % 4);
   return &controller->group[gid];
 }
 
@@ -542,7 +540,7 @@ read_icr (struct hw *me,
        {
        case 0:
          val = INSERT_ID (group->request);
-         HW_TRACE ((me, "read-icr group=%d nmi 0x%02x",
+         HW_TRACE ((me, "read-icr group=%d:0 nmi 0x%02x",
                     group->gid, val));
          break;
        default:
@@ -556,13 +554,13 @@ read_icr (struct hw *me,
        case 0:
          val = (INSERT_IR (group->request)
                 | INSERT_ID (group->request & group->enable));
-         HW_TRACE ((me, "read-icr group=%d level 0 0x%02x",
+         HW_TRACE ((me, "read-icr group=%d:0 level 0x%02x",
                     group->gid, val));
          break;
        case 1:
          val = (INSERT_LV (group->level)
                 | INSERT_IE (group->enable));
-         HW_TRACE ((me, "read-icr level-%d level 1 0x%02x",
+         HW_TRACE ((me, "read-icr level-%d:1 level 0x%02x",
                     group->gid, val));
          break;
        }
@@ -591,7 +589,7 @@ write_icr (struct hw *me,
       switch (offset)
        {
        case 0:
-         HW_TRACE ((me, "write-icr group=%d nmi 0x%02x",
+         HW_TRACE ((me, "write-icr group=%d:0 nmi 0x%02x",
                     group->gid, val));
          group->request &= ~EXTRACT_ID (val);
          break;
@@ -605,13 +603,16 @@ write_icr (struct hw *me,
        {
        case 0: /* request/detect */
          /* Clear any ID bits and then set them according to IR */
-         HW_TRACE ((me, "write-icr group=%d level 0 0x%02x",
-                    group->gid, val));
-         group->request &= EXTRACT_ID (val);
-         group->request |= EXTRACT_IR (val) & EXTRACT_ID (val);
+         HW_TRACE ((me, "write-icr group=%d:0 level 0x%02x %x:%x:%x",
+                    group->gid, val,
+                    group->request, EXTRACT_IR (val), EXTRACT_ID (val)));
+         group->request =
+           ((EXTRACT_IR (val) & EXTRACT_ID (val))
+            | (EXTRACT_IR (val) & group->request)
+            | (~EXTRACT_IR (val) & ~EXTRACT_ID (val) & group->request));
          break;
        case 1: /* level/enable */
-         HW_TRACE ((me, "write-icr group=%d level 1 0x%02x",
+         HW_TRACE ((me, "write-icr group=%d:1 level 0x%02x",
                     group->gid, val));
          group->level = EXTRACT_LV (val);
          group->enable = EXTRACT_IE (val);
@@ -642,14 +643,24 @@ read_iagr (struct hw *me,
     {
     case 0:
       {
-       val = (controller->interrupt_accepted_group << 2);
-       if (!(controller->group[val].request
-             & controller->group[val].enable))
-         /* oops, lost the request */
-         val = 0;
-       HW_TRACE ((me, "read-iagr %d", (int) val));
+       if (!(controller->group[controller->interrupt_accepted_group].request
+             & controller->group[controller->interrupt_accepted_group].enable))
+         {
+           /* oops, lost the request */
+           val = 0;
+           HW_TRACE ((me, "read-iagr:0 lost-0"));
+         }
+       else
+         {
+           val = (controller->interrupt_accepted_group << 2);
+           HW_TRACE ((me, "read-iagr:0 %d", (int) val));
+         }
        break;
       }
+    case 1:
+      val = 0;
+      HW_TRACE ((me, "read-iagr:1 %d", (int) val));
+      break;
     default:
       val = 0;
       HW_TRACE ((me, "read-iagr 0x%08lx bad offset", (long) offset));
@@ -743,14 +754,12 @@ mn103int_io_read_buffer (struct hw *me,
                         void *dest,
                         int space,
                         unsigned_word base,
-                        unsigned nr_bytes,
-                        sim_cpu *processor,
-                        sim_cia cia)
+                        unsigned nr_bytes)
 {
   struct mn103int *controller = hw_data (me);
   unsigned8 *buf = dest;
   unsigned byte;
-  HW_TRACE ((me, "read 0x%08lx %d", (long) base, (int) nr_bytes));
+  /* HW_TRACE ((me, "read 0x%08lx %d", (long) base, (int) nr_bytes)); */
   for (byte = 0; byte < nr_bytes; byte++)
     {
       unsigned_word address = base + byte;
@@ -778,14 +787,12 @@ mn103int_io_write_buffer (struct hw *me,
                          const void *source,
                          int space,
                          unsigned_word base,
-                         unsigned nr_bytes,
-                         sim_cpu *cpu,
-                         sim_cia cia)
+                         unsigned nr_bytes)
 {
   struct mn103int *controller = hw_data (me);
   const unsigned8 *buf = source;
   unsigned byte;
-  HW_TRACE ((me, "write 0x%08lx %d", (long) base, (int) nr_bytes));
+  /* HW_TRACE ((me, "write 0x%08lx %d", (long) base, (int) nr_bytes)); */
   for (byte = 0; byte < nr_bytes; byte++)
     {
       unsigned_word address = base + byte;
@@ -809,7 +816,7 @@ mn103int_io_write_buffer (struct hw *me,
 }     
 
 
-const struct hw_device_descriptor dv_mn103int_descriptor[] = {
+const struct hw_descriptor dv_mn103int_descriptor[] = {
   { "mn103int", mn103int_finish, },
   { NULL },
 };
index 11b7fac9aba8665facf6fcd1f8e662fef24da571..d1ad04e5fd20c0a421d2945422f1b0cae22b1c57 100644 (file)
@@ -1,6 +1,50 @@
+Thu May 21 19:04:52 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * Makefile.in (TESTS): Add t-sub.ok.
+       (t-sub.s): New file.
+
+Thu May 14 14:43:17 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * t-div.s, t-ddiv.s, t-div1.s: Check DIV for x/0 and MIN_INT/-1.
+       * t-divu1.s, t-divu.s: Check x/0 and x/MAX_INT.
+       * t-dadd: Test.
+       * trap.s: Test trap instruction.
+       * Makefile.in (TESTS): Update
+       
+       * f-add.s, f-adda.s, f-madd.s, f-madda.s, f-msub.s, f-msuba.s: Add
+       more test cases.
+       
+Thu Apr 30 18:57:47 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * f-adda.s: Handle to-the-max accumulator values in madd.s.
+
+       * t-macros.i: Use msub.s instead of madd.s to get a value from the
+       accumulator.  Use suba.s instead of adda.s to get a value into the
+       accumulator.
+
+Thu Apr 16 17:44:17 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * f-mul.s, f-mula.s: More overflow/underflow tests.
+
+       * f-cvt.s: Swap cvt.w.s and cvt.s.w was testing backwards.
+
+       * t-macros.i (loadfpx, checkfpx, checkaccx): Define, accept hex
+       values.
+       (checkfp): Force FP-SCR register bit zero to 1 when checking.
+       
+Wed Feb 25 20:26:29 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * f-*.s: New files.
+
+       * Makefile.in (TESTS): Add floating point f-* tests.
+
+       * t-macros.i: Add lots of floating point macros.
+       
 Mon Feb  2 16:50:21 1998  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * t-sdl.s: New test.
+       (dest): 8 byte align sdl destination.
+
        * Makefile.in: Update.
 
 Wed Sep  3 14:32:42 1997  Andrew Cagney  <cagney@b1.cygnus.com>
diff --git a/sim/testsuite/mips64r5900-elf/Makefile.in b/sim/testsuite/mips64r5900-elf/Makefile.in
new file mode 100644 (file)
index 0000000..120337e
--- /dev/null
@@ -0,0 +1,271 @@
+# Makefile for regression testing the GNU debugger.
+# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+# This file is part of GDB.
+
+# GDB 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.
+
+# GDB 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.
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+srcroot = $(srcdir)/..
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+host_alias = @host_alias@
+target_alias = @target_alias@
+program_transform_name = @program_transform_name@
+build_canonical = @build@
+host_canonical = @host@
+target_canonical = @target@
+target_cpu = @target_cpu@
+
+
+SHELL = /bin/sh
+SUBDIRS = @subdirs@
+RPATH_ENVVAR = @RPATH_ENVVAR@
+
+EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
+          echo $${rootme}/../../expect/expect ; \
+          else echo expect ; fi`
+
+RUNTEST = $(RUNTEST_FOR_TARGET)
+
+RUNTESTFLAGS =
+
+RUNTEST_FOR_TARGET = `\
+  if [ -f $${srcdir}/../../../dejagnu/runtest ]; then \
+    echo $${srcdir}/../../../dejagnu/runtest; \
+  else \
+    if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
+      echo runtest; \
+    else \
+      t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
+    fi; \
+  fi`
+
+
+AS_FOR_TARGET = `\
+  if [ -x ../../../gas/as-new ]; then \
+    echo ../../../gas/as-new ; \
+  else \
+    echo $(target_alias)-as ; \
+  fi`
+
+LD_FOR_TARGET = `\
+  if [ -x ../../../ld/ld-new ]; then \
+    echo ../../../ld/ld-new ; \
+  else \
+    echo $(target_alias)-ld ; \
+  fi`
+
+RUN_FOR_TARGET = `\
+  if [ -x ../../../sim/mips/run ]; then \
+    echo ../../../sim/mips/run ; \
+  else \
+    echo $(target_alias)-run ; \
+  fi`
+
+TESTS = \
+       hello.hi \
+       exit47.ko \
+       \
+       f-abs.ok \
+       f-add.ok \
+       f-adda.ok \
+       $(f-bc1f.ok) \
+       $(f-bc1fl.ok) \
+       $(f-bc1t.ok) \
+       $(f-bc1tl.ok) \
+       f-cond.ok \
+       $(f-cfc1.ok) \
+       $(f-ctc1.ok) \
+       f-cvt.ok \
+       f-div.ok \
+       $(f-lwc1.ok) \
+       f-madd.ok \
+       f-madda.ok \
+       f-max.ok \
+       $(f-mfc1.ok) \
+       f-min.ok \
+       f-msub.ok \
+       f-msuba.ok \
+       $(f-mtc1.ok) \
+       f-mul.ok \
+       f-mula.ok \
+       f-neg.ok \
+       f-rsqrt.ok \
+       f-sqrt.ok \
+       f-sub.ok \
+       f-suba.ok \
+       $(f-swc1.ok) \
+       \
+       t-dadd.ok \
+       t-ddiv.ok \
+       t-div.ok \
+       t-div1.ok \
+       t-divu.ok \
+       t-divu1.ok \
+       t-sub.ok \
+       \
+       t-mtsa.ok \
+       t-pabsh.ok \
+       t-pabsw.ok \
+       t-paddb.ok \
+       t-paddsb.ok \
+       t-paddsh.ok \
+       t-paddsw.ok \
+       t-paddub.ok \
+       t-padduh.ok \
+       t-padduw.ok \
+       t-pcpyh.ok \
+       t-pdivbw.ok \
+       t-pdivuw.ok \
+       t-pdivw.ok \
+       t-pexcw.ok \
+       t-pexoh.ok \
+       t-pext5.ok \
+       t-pextlb.ok \
+       t-pextlh.ok \
+       t-pextlw.ok \
+       t-pextub.ok \
+       t-pextuh.ok \
+       t-pextuw.ok \
+       t-phmaddh.ok \
+       t-phmsubh.ok \
+       t-pinth.ok \
+       t-pintoh.ok \
+       t-pmaddh.ok \
+       t-pmadduw.ok \
+       t-pmaddw.ok \
+       t-pmfhl-lh.ok \
+       t-pmfhl-lw.ok \
+       t-pmfhl-sh.ok \
+       t-pmfhl-slw.ok \
+       t-pmfhl-uw.ok \
+       t-pmsubh.ok \
+       t-pmthl-lw.ok \
+       t-pmulth.ok \
+       t-pmultuw.ok \
+       t-pmultw.ok \
+       t-ppac5.ok \
+       t-ppacb.ok \
+       t-ppach.ok \
+       t-ppacw.ok \
+       t-prot3w.ok \
+       t-psllvw.ok \
+       t-psrlvw.ok \
+       t-psravw.ok \
+       t-psubsb.ok \
+       t-psubsh.ok \
+       t-psubsw.ok \
+       t-psubub.ok \
+       t-psubuh.ok \
+       t-psubuw.ok \
+       t-psubw.ok \
+       t-qfsrv.ok \
+       t-sdl.ok \
+       \
+       trap.ok \
+
+check: sanity $(TESTS)
+sanity:
+       @eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
+       @eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
+       @eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
+
+
+
+# Rules for running all the tests, put into three types
+# exit success, exit fail, print "Hello World"
+
+.u.log:
+       uudecode $*.u
+       $(RUN_FOR_TARGET) $* > $*.log
+
+
+# Rules for running the tests
+
+.SUFFIXES: .u .uue .ok .ok .run .hi .ko .ko
+.run.ok:
+       rm -f tmp-$* $*.ok
+       ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
+       mv tmp-$* $*.ok
+.run.hi:
+       rm -f tmp-$* $*.hi diff-$*
+       ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
+       echo 'Hello World!' | diff - tmp-$* > diff-$*
+       cat tmp-$* diff-$* > $*.hi
+.run.ko:
+       rm -f tmp-$* $*.ko
+       set +e ; \
+       ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \
+       if [ $$? -eq 47 ] ; then \
+         exit 0 ; \
+       else \
+         exit 1 ; \
+       fi
+       mv tmp-$* $*.ko
+
+
+# Rules for building all the tests and packing them into
+# uuencoded files.
+
+.run.u:
+       uuencode < $*.run $*.run > $*.u
+       @echo "Move $*.u $*.uue"
+.uue.run:
+       uudecode $(srcdir)/$*.uue
+.o.run:
+       $(LD_FOR_TARGET) -Ttext 0xa0020000 -o $*.run $*.o
+.s.o:
+       $(AS_FOR_TARGET) -I $(srcdir) $(srcdir)/$*.s -o $*.o
+
+
+#
+# Standard
+#
+clean mostlyclean:
+       -rm -f *~ core *.o a.out *.x *.grt *.run tmp-* diff-*
+       rm -f $(TESTS)
+#      if [ x"${SUBDIRS}" != x ] ; then \
+#          for dir in ${SUBDIRS}; \
+#          do \
+#                  echo "$$dir:"; \
+#                  if [ -d $$dir ]; then \
+#                          (cd $$dir; $(MAKE) clean); \
+#                  fi; \
+#          done ; \
+#      else true; fi
+
+distclean maintainer-clean realclean: clean
+       -rm -f *~ core
+       -rm -f Makefile config.status *-init.exp
+       -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+#      if [ x"${SUBDIRS}" != x ] ; then \
+#          for dir in ${SUBDIRS}; \
+#          do \
+#                  echo "$$dir:"; \
+#                  if [ -d $$dir ]; then \
+#                          (cd $$dir; $(MAKE) distclean); \
+#                  fi; \
+#          done ; \
+#      else true; fi
+
+Makefile : Makefile.in config.status
+       $(SHELL) config.status
+
+config.status: configure
+       $(SHELL) config.status --recheck
diff --git a/sim/testsuite/mips64r5900-elf/t-sub.s b/sim/testsuite/mips64r5900-elf/t-sub.s
new file mode 100644 (file)
index 0000000..ef314ae
--- /dev/null
@@ -0,0 +1,26 @@
+.include "t-macros.i"
+
+       start
+
+test_sub:
+
+       load $7 0x0000000000000000 0xffffffff80000001
+       load $8 0x0000000000000000 0xffffffffffffffff
+        sub $10, $7, $8
+       check10 0x0000000000000000 0xffffffff80000002
+
+test_sub2:
+       load $7 0x0000000000000000 0xffffffff80000001
+       load $8 0x0000000000000000 0x0000000000000001
+        sub $10, $7, $8
+       check10 0x0000000000000000 0xffffffff80000000
+
+
+test_sub3:
+       load $7 0x0000000000000000 0x0000000000000001
+       load $8 0x0000000000000000 0x0000000000000002
+        sub $10, $7, $8
+       check10 0x0000000000000000 0xffffffffffffffff
+
+       
+               exit0