public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: cgen@sources.redhat.com
Subject: patch to insn.scm
Date: Thu, 12 Jul 2001 04:42:00 -0000	[thread overview]
Message-ID: <20010712074149.C15543@redhat.com> (raw)

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 "

                 reply	other threads:[~2001-07-12  4:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010712074149.C15543@redhat.com \
    --to=fche@redhat.com \
    --cc=cgen@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).