From de799070f01b89a955729a97464dd4e87ced0a7b Mon Sep 17 00:00:00 2001 From: devans Date: Thu, 15 May 2003 07:16:52 +0000 Subject: [PATCH] * utils-sim.scm (-gen-decoder-switch): Back out patch of 2003-01-09. (-gen-decode-bits): Instead put in better fix here. --- cgen/ChangeLog | 3 +++ cgen/utils-sim.scm | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cgen/ChangeLog b/cgen/ChangeLog index 33e37620e8..c60be5ee64 100644 --- a/cgen/ChangeLog +++ b/cgen/ChangeLog @@ -1,5 +1,8 @@ 2003-05-15 Doug Evans + * utils-sim.scm (-gen-decoder-switch): Back out patch of 2003-01-09. + (-gen-decode-bits): Instead put in better fix here. + * cpu/i960.cpu (index): Rename to indx. All uses updated. 2003-05-01 DJ Delorie diff --git a/cgen/utils-sim.scm b/cgen/utils-sim.scm index 4a291fbf74..366948362d 100644 --- a/cgen/utils-sim.scm +++ b/cgen/utils-sim.scm @@ -550,7 +550,11 @@ pos (+ 1 count) (cdr bitnums))))))) (string-append - "(" + ; While we could just always emit "(0" to handle the case of an empty set, + ; keeping the code more readable for the normal case is important. + (if (< (length groups) 1) + "(0" + "(") (string-drop 3 (string-map (lambda (group) @@ -938,11 +942,9 @@ ";\n" indent " val = ")) (string-append indent " unsigned int val = ")) - (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?)) + (-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" -- 2.11.0