]> sourceware.org Git - cgen.git/commitdiff
* types.scm (bitrange-overlap?): Handle lsb0?.
authorHans-Peter Nilsson <hans-peter.nilsson@axis.com>
Mon, 7 Oct 2002 23:50:30 +0000 (23:50 +0000)
committerHans-Peter Nilsson <hans-peter.nilsson@axis.com>
Mon, 7 Oct 2002 23:50:30 +0000 (23:50 +0000)
ChangeLog
types.scm

index d18890814ce7cc0aaf742aea2419a0e6afde7002..a27b627df7ca6c410af98cb18b00180dc3ee61a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-08  Doug Evans  <dje@transmeta.com>
+           Hans-Peter Nilsson  <hp@axis.com>
+
+       * types.scm (bitrange-overlap?): Handle lsb0?.
+
 2002-09-07  Frank Ch. Eigler  <fche@redhat.com>
 
        From Robert Cragie <rcc@jennic.com>:
index dec4142e5af4c65d1ff1077f9146ef82f8d6f7aa..eb8d2b54ac91e796d00423908f86527e3c5e1324 100644 (file)
--- a/types.scm
+++ b/types.scm
 ; Return a boolean indicating if two bitranges overlap.
 
 (define (bitrange-overlap? start1 length1 start2 length2 lsb0?)
-  ; ??? lsb0?
-  (let ((end1 (+ start1 length1))
-       (end2 (+ start2 length2)))
-    (not (or (<= end1 start2)
-            (>= start1 end2))))
+  (if lsb0?
+      (let ((end1 (- start1 length1))
+           (end2 (- start2 length2)))
+       (and (< end1 start2)
+            (> start1 end2)))
+      (let ((end1 (+ start1 length1))
+           (end2 (+ start2 length2)))
+       (and (> end1 start2)
+            (< start1 end2))))
 )
 
 ; Return a boolean indicating if BITPOS is beyond bitrange START,LEN.
This page took 0.034083 seconds and 5 git commands to generate.