Doug Evans | 9 Jan 2003 04:44

decoder bug fix

Ben Elliston writes:
 > I am committing the following patch (written by Graydon Hoare last
 > year) that fixes an edge condition in the (-gen-decoder-switch) logic.
 > 
 > Ben
 > 
 > 2003-01-09  Ben Elliston  <bje <at> redhat.com>
 > 
 >         From Graydon Hoare <graydon <at> redhat.com>:
 >         * utils-sim.scm (-gen-decoder-switch): Fix edge condition 
 >         empty ISAs.
 > 
 > Index: utils-sim.scm
 > ===================================================================
 > RCS file: /cvs/src/src/cgen/utils-sim.scm,v
 > retrieving revision 1.8
 > diff -u -p -r1.8 utils-sim.scm
 > --- utils-sim.scm       20 Dec 2002 07:58:32 -0000      1.8
 > +++ utils-sim.scm       9 Jan 2003 03:05:01 -0000
 >  <at>  <at>  -938,9 +938,11  <at>  <at> 
 >                         ";\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)
(Continue reading)

Ben Elliston | 9 Jan 2003 05:02
Picon
Favicon

Re: decoder bug fix

>>>>> "Doug" == Doug Evans <dje <at> transmeta.com> writes:

  Doug> This is ok with me, though I can make an argument to fix
  Doug> -gen-decode-bits instead.  Without having tried it, seems like
  Doug> this should work.

The patch is in, so feel free to improve on it if you wish.

Ben


Gmane