From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15027 invoked by alias); 9 Jan 2003 03:07:49 -0000 Mailing-List: contact cgen-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sources.redhat.com Received: (qmail 14919 invoked from network); 9 Jan 2003 03:07:47 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 9 Jan 2003 03:07:47 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h092doB31233 for ; Wed, 8 Jan 2003 21:39:50 -0500 Received: from hypatia.brisbane.redhat.com (IDENT:root@hypatia.brisbane.redhat.com [172.16.5.3]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0937Ya26393 for ; Wed, 8 Jan 2003 22:07:35 -0500 Received: from scooby.brisbane.redhat.com (scooby.brisbane.redhat.com [172.16.5.228]) by hypatia.brisbane.redhat.com (8.11.6/8.11.6) with ESMTP id h0937Ww14540 for ; Thu, 9 Jan 2003 13:07:32 +1000 Received: by scooby.brisbane.redhat.com (Postfix, from userid 500) id 7DE551BE0; Wed, 8 Jan 2003 22:07:30 -0500 (EST) To: cgen@sources.redhat.com Subject: decoder bug fix From: Ben Elliston Date: Thu, 09 Jan 2003 03:07:00 -0000 Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q1/txt/msg00003.txt.bz2 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 From Graydon Hoare : * 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 @@ -938,9 +938,11 @@ ";\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" <