OSDN Git Service

2003-01-09 Ben Elliston <bje@redhat.com>
authorbje <bje>
Thu, 9 Jan 2003 03:08:32 +0000 (03:08 +0000)
committerbje <bje>
Thu, 9 Jan 2003 03:08:32 +0000 (03:08 +0000)
        From Graydon Hoare <graydon@redhat.com>:
* utils-sim.scm (-gen-decoder-switch): Fix edge condition for
empty ISAs.

cgen/ChangeLog
cgen/utils-sim.scm

index 0a670ef..351b724 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-09  Ben Elliston  <bje@redhat.com>
+
+        From Graydon Hoare <graydon@redhat.com>:
+       * utils-sim.scm (-gen-decoder-switch): Fix edge condition for
+       empty ISAs.
+
 2002-12-21  Doug Evans  <dje@sebabeach.org>
 
        * ifield.scm (-ifield-parse): Rewrite <bitrange> computation.
index b049a61..4a291fb 100644 (file)
                        ";\n"
                        indent "  val = "))
        (string-append indent "  unsigned int val = "))
-   (-gen-decode-bits (dtable-guts-bitnums table-guts)
-                    (dtable-guts-startbit table-guts)
-                    (dtable-guts-bitsize table-guts) "insn" lsb0?)
+   (if (< (length (dtable-guts-bitnums table-guts)) 1)
+       "0"
+       (-gen-decode-bits (dtable-guts-bitnums table-guts)
+                        (dtable-guts-startbit table-guts)
+                        (dtable-guts-bitsize table-guts) "insn" lsb0?))
    ";\n"
    indent "  switch (val)\n"
    indent "  {\n"