* patch to insn.scm
@ 2001-07-12 4:42 Frank Ch. Eigler
0 siblings, 0 replies; only message in thread
From: Frank Ch. Eigler @ 2001-07-12 4:42 UTC (permalink / raw)
To: cgen
Hi -
The following patch fixes a long-standing bug that I introduced into cgen.
It silently ignored duplicate sets of instructions during sim decoder
generation instead of reporting an ambiguity. Committing, enjoy, sorry.
2001-07-12 Frank Ch. Eigler <fche@redhat.com>
* insn.scm (filter-harmlessly-ambiguous-insns): Fix msg typo.
(mask-superset?): Look for strict supersets to allow rejection of
duplicate insns.
Index: insn.scm
===================================================================
RCS file: /cvs/src/src/cgen/insn.scm,v
retrieving revision 1.2
diff -u -r1.2 insn.scm
--- insn.scm 2000/10/27 02:28:06 1.2
+++ insn.scm 2001/07/12 11:40:03
@@ -729,22 +729,25 @@
(keep? (not superset-insn)))
(if (not keep?)
(logit 2
- "Instruction " (obj:name insn) "ambiguity-filtered by "
+ "Instruction " (obj:name insn) " ambiguity-filtered by "
(obj:name superset-insn) "\n"))
keep?))
insn-list)
)
-; Helper function for above: does (m1,v1) match a superset of (m2,v2) ?
+; Helper function for above: does (m1,v1) match a STRICT superset of (m2,v2) ?
;
; eg> mask-superset? #b1100 #b1000 #b1110 #b1010 -> #t
; eg> mask-superset? #b1100 #b1000 #b1010 #b1010 -> #f
; eg> mask-superset? #b1100 #b1000 #b1110 #b1100 -> #f
+; eg> mask-superset? #b1100 #b1000 #b1100 #b1000 -> #f
+;
(define (mask-superset? m1 v1 m2 v2)
(let ((result
(and (= (cg-logand m1 m2) m1)
- (= (cg-logand m1 v1) (cg-logand m1 v2)))))
+ (= (cg-logand m1 v1) (cg-logand m1 v2))
+ (not (and (= m1 m2) (= v1 v2))))))
(if result (logit 4
"(" (number->string m1 16) "," (number->string v1 16) ")"
" contains "
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-12 4:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12 4:42 patch to insn.scm Frank Ch. Eigler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).