* gas/mips/itbl: Add comments.
authorDawn Perchik <dawn@cygnus>
Mon, 24 Feb 1997 01:17:50 +0000 (01:17 +0000)
committerDawn Perchik <dawn@cygnus>
Mon, 24 Feb 1997 01:17:50 +0000 (01:17 +0000)
* gas/mips/itbl.s: Add comments.  Prefix register names with $.
* gas/all/itbl: Generic table for testing for itbl support.
* gas/all/itbl.s: Generic assembly for testing for itbl support.
* gas/mips/itbl-test.c: Moved to gas/all.
* gas/all/itbl-test.c: Moved from gas/mips.

gas/testsuite/ChangeLog
gas/testsuite/gas/all/.Sanitize
gas/testsuite/gas/all/itbl [new file with mode: 0644]
gas/testsuite/gas/all/itbl-test.c [new file with mode: 0644]
gas/testsuite/gas/all/itbl.s [new file with mode: 0644]
gas/testsuite/gas/mips/.Sanitize
gas/testsuite/gas/mips/itbl-test.c [deleted file]

index ff99ebfa45b9a460bc071025abf23947ef6149f5..584b974d3712b69747fca0ce1202dcb3e6939a76 100644 (file)
@@ -1,3 +1,13 @@
+
+Sun Feb 23 17:22:00 1997  Dawn Perchik  <dawn@cygnus.com>
+
+       * gas/mips/itbl: Add comments.
+       * gas/mips/itbl.s: Add comments.  Prefix register names with $.
+       * gas/all/itbl: Generic table for testing for itbl support.
+       * gas/all/itbl.s: Generic assembly for testing for itbl support.
+       * gas/mips/itbl-test.c: Moved to gas/all.
+       * gas/all/itbl-test.c: Moved from gas/mips.
+
 start-sanitize-tic80
 Sat Feb 22 20:24:23 1997  Fred Fish  <fnf@cygnus.com>
 
index e6e70ed11247bb1bbe795e30ae204e2e555ce424..57d6c24cce11de7b803d5423cea543ee1cde1264 100644 (file)
@@ -34,6 +34,9 @@ cofftag.s
 comment.s
 diff1.s
 float.s
+itbl
+itbl.s
+itbl-test.c
 p1480.s
 p2425.s
 struct.d
diff --git a/gas/testsuite/gas/all/itbl b/gas/testsuite/gas/all/itbl
new file mode 100644 (file)
index 0000000..ac66dfb
--- /dev/null
@@ -0,0 +1,20 @@
+
+    ; Test case for assembler option "itbl".
+    ; Run as "as --itbl itbl itbl.s"
+    ; or with stand-alone test case "itbl-test itbl itbl.s".
+    ; The "p<n>" represent processors of a multi-processor system.
+
+    p1 dreg d1 1        ; data register "d1" for COP1 has value 1
+    p1 creg c3 3        ; ctrl register "c3" for COP1 has value 3
+    p3 insn fie 0x1e:24-20      ; function "fill" for COP3 has value 31
+    p3 dreg d3 3        ; data register "d3" for COP3 has value 3
+    p3 creg c2 22       ; control register "c2" for COP3 has value 22
+    p3 insn fee 0x1e:24-20,dreg:17-13,creg:12-8,immed:7-0
+
+    p3 dreg d3 3        ; data register "d3" for COP3 has value 3
+    p3 creg c2 22       ; control register "c2" for COP3 has value 22
+    p3 insn fum 0x01e00001 dreg:17-13 creg:12-8
+    p3 insn foh 0xf:24-21 dreg:20-16 immed:15-0
+
+    p3 insn pig 0x1:24-21*[0x100|0x2], dreg:20-16, immed:15-0*0x10000
+
diff --git a/gas/testsuite/gas/all/itbl-test.c b/gas/testsuite/gas/all/itbl-test.c
new file mode 100644 (file)
index 0000000..8b8e896
--- /dev/null
@@ -0,0 +1,128 @@
+
+
+/* itbl-test.c
+
+   Copyright (C) 1997  Free Software Foundation, Inc.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS 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.
+
+   GAS 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 GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.  */
+
+/* Stand-alone test for instruction specification table support.
+   Run using "itbl-test <itbl> <asm.s>"
+   where <itbl> is the name of the instruction table,
+   and <asm.s> is the name of the assembler fie. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "itbl-ops.h"
+
+static int test_reg (e_processor processor, e_type type, char *name,
+                    unsigned long val);
+
+int 
+main (int argc, char **argv)
+{
+  unsigned int insn;
+  FILE *fas;
+  int aline = 0;
+  char s[81], *name;
+
+  if (argc < 3)
+    {
+      printf ("usage: %s itbl asm.s\n", argv[0]);
+      exit (0);
+    }
+  if (itbl_parse (argv[1]) != 0)
+    {
+      printf ("failed to parse itbl\n");
+      exit (0);
+    }
+
+  fas = fopen (argv[2], "r");
+  if (fas == 0)
+    {
+      printf ("failed to open asm file %s\n", argv[2]);
+      exit (0);
+    }
+  while (fgets (s, 80, fas))
+    {
+      char *p;
+      aline++;
+
+      if (p = strchr (s, ';'), p)      /* strip comments */
+       *p = 0;
+      if (p = strchr (s, '#'), p)      /* strip comments */
+       *p = 0;
+      p = s + strlen (s) - 1;
+      while (p >= s && (*p == ' ' || *p == '\t' || *p == '\n'))        /* strip trailing spaces */
+       p--;
+      *(p + 1) = 0;
+      p = s;
+      while (*p && (*p == ' ' || *p == '\t' || *p == '\n'))    /* strip leading spaces */
+       p++;
+      if (!*p)
+       continue;
+
+      name = itbl_get_insn_name (&p);
+      insn = itbl_assemble (name, p);
+      if (insn == 0)
+       printf ("line %d: Invalid instruction (%s)\n", aline, s);
+      else
+       {
+         char buf[128];
+         printf ("line %d: insn(%s) = 0x%x)\n", aline, s, insn);
+         if (!itbl_disassemble (buf, insn))
+           printf ("line %d: Can't disassemble instruction "
+                   "(0x%x)\n", aline, insn);
+         else
+           printf ("line %d: disasm(0x%x) = %s)\n", aline, insn, buf);
+       }
+    }
+
+  test_reg (1, e_dreg, "d1", 1);
+  test_reg (3, e_creg, "c2", 22);
+  test_reg (3, e_dreg, "d3", 3);
+
+  return 0;
+}
+
+static int 
+test_reg (e_processor processor, e_type type, char *name,
+         unsigned long val)
+{
+  char *n;
+  unsigned long v;
+
+  n = itbl_get_reg_name (processor, type, val);
+  if (!n || strcmp (n, name))
+    printf ("Error - reg name not found for proessor=%d, type=%d, val=%d\n",
+           processor, type, val);
+  else
+    printf ("name=%s found for processor=%d, type=%d, val=%d\n",
+           n, processor, type, val);
+
+  v = itbl_get_reg_val (processor, type, name);
+  if (!v || v != val)
+    printf ("Error - reg val not found for processor=%d, type=%d, name=%s\n",
+           processor, type, name);
+  else
+    printf ("val=0x%x found for processor=%d, type=%d, name=%s\n",
+           v, processor, type, name);
+  return 0;
+}
diff --git a/gas/testsuite/gas/all/itbl.s b/gas/testsuite/gas/all/itbl.s
new file mode 100644 (file)
index 0000000..9351aa4
--- /dev/null
@@ -0,0 +1,13 @@
+
+    ; Test case for assembler option "itbl".
+    ; Run as "as --itbl itbl itbl.s"
+    ; or with stand-alone test case "itbl-test itbl itbl.s".
+
+    ; Assemble processor instructions as defined in "itbl".
+
+    fee $d3,$c2,0x1    ;  0x4ff07601
+    fie                ;  0x4ff00000
+    foh $2,0x100
+    fum $d3,$c2        ;  0x4ff07601
+    pig $2,0x100
+
index 6d370dbca25c58925eb508fe627a1c4a910179d6..f62406958c06b9269f7b2da09b4555163ee76d81 100644 (file)
@@ -47,7 +47,6 @@ dli.d
 dli.s
 itbl
 itbl.s
-itbl-test.c
 jal-empic.d
 jal-svr4pic.d
 jal-svr4pic.s
diff --git a/gas/testsuite/gas/mips/itbl-test.c b/gas/testsuite/gas/mips/itbl-test.c
deleted file mode 100644 (file)
index 8b8e896..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-/* itbl-test.c
-
-   Copyright (C) 1997  Free Software Foundation, Inc.
-
-   This file is part of GAS, the GNU Assembler.
-
-   GAS 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.
-
-   GAS 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 GAS; see the file COPYING.  If not, write to the Free
-   Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.  */
-
-/* Stand-alone test for instruction specification table support.
-   Run using "itbl-test <itbl> <asm.s>"
-   where <itbl> is the name of the instruction table,
-   and <asm.s> is the name of the assembler fie. */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "itbl-ops.h"
-
-static int test_reg (e_processor processor, e_type type, char *name,
-                    unsigned long val);
-
-int 
-main (int argc, char **argv)
-{
-  unsigned int insn;
-  FILE *fas;
-  int aline = 0;
-  char s[81], *name;
-
-  if (argc < 3)
-    {
-      printf ("usage: %s itbl asm.s\n", argv[0]);
-      exit (0);
-    }
-  if (itbl_parse (argv[1]) != 0)
-    {
-      printf ("failed to parse itbl\n");
-      exit (0);
-    }
-
-  fas = fopen (argv[2], "r");
-  if (fas == 0)
-    {
-      printf ("failed to open asm file %s\n", argv[2]);
-      exit (0);
-    }
-  while (fgets (s, 80, fas))
-    {
-      char *p;
-      aline++;
-
-      if (p = strchr (s, ';'), p)      /* strip comments */
-       *p = 0;
-      if (p = strchr (s, '#'), p)      /* strip comments */
-       *p = 0;
-      p = s + strlen (s) - 1;
-      while (p >= s && (*p == ' ' || *p == '\t' || *p == '\n'))        /* strip trailing spaces */
-       p--;
-      *(p + 1) = 0;
-      p = s;
-      while (*p && (*p == ' ' || *p == '\t' || *p == '\n'))    /* strip leading spaces */
-       p++;
-      if (!*p)
-       continue;
-
-      name = itbl_get_insn_name (&p);
-      insn = itbl_assemble (name, p);
-      if (insn == 0)
-       printf ("line %d: Invalid instruction (%s)\n", aline, s);
-      else
-       {
-         char buf[128];
-         printf ("line %d: insn(%s) = 0x%x)\n", aline, s, insn);
-         if (!itbl_disassemble (buf, insn))
-           printf ("line %d: Can't disassemble instruction "
-                   "(0x%x)\n", aline, insn);
-         else
-           printf ("line %d: disasm(0x%x) = %s)\n", aline, insn, buf);
-       }
-    }
-
-  test_reg (1, e_dreg, "d1", 1);
-  test_reg (3, e_creg, "c2", 22);
-  test_reg (3, e_dreg, "d3", 3);
-
-  return 0;
-}
-
-static int 
-test_reg (e_processor processor, e_type type, char *name,
-         unsigned long val)
-{
-  char *n;
-  unsigned long v;
-
-  n = itbl_get_reg_name (processor, type, val);
-  if (!n || strcmp (n, name))
-    printf ("Error - reg name not found for proessor=%d, type=%d, val=%d\n",
-           processor, type, val);
-  else
-    printf ("name=%s found for processor=%d, type=%d, val=%d\n",
-           n, processor, type, val);
-
-  v = itbl_get_reg_val (processor, type, name);
-  if (!v || v != val)
-    printf ("Error - reg val not found for processor=%d, type=%d, name=%s\n",
-           processor, type, name);
-  else
-    printf ("val=0x%x found for processor=%d, type=%d, name=%s\n",
-           v, processor, type, name);
-  return 0;
-}
This page took 0.035628 seconds and 4 git commands to generate.