From dd2cb3ffadb8b425db9c16d576c7642a041c2aee Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Thu, 9 Jan 2003 03:08:32 +0000 Subject: [PATCH] 2003-01-09 Ben Elliston From Graydon Hoare : * utils-sim.scm (-gen-decoder-switch): Fix edge condition for empty ISAs. --- ChangeLog | 6 ++++++ utils-sim.scm | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a670ef..351b724 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-01-09 Ben Elliston + + From Graydon Hoare : + * utils-sim.scm (-gen-decoder-switch): Fix edge condition for + empty ISAs. + 2002-12-21 Doug Evans * ifield.scm (-ifield-parse): Rewrite computation. diff --git a/utils-sim.scm b/utils-sim.scm index b049a61..4a291fb 100644 --- a/utils-sim.scm +++ b/utils-sim.scm @@ -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" -- 2.43.5