From e6893d3560f760d15c916b4f8d8687b2f4cf99f2 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 7 Oct 2002 23:50:30 +0000 Subject: [PATCH] * types.scm (bitrange-overlap?): Handle lsb0?. --- ChangeLog | 5 +++++ types.scm | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d188908..a27b627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-10-08 Doug Evans + Hans-Peter Nilsson + + * types.scm (bitrange-overlap?): Handle lsb0?. + 2002-09-07 Frank Ch. Eigler From Robert Cragie : diff --git a/types.scm b/types.scm index dec4142..eb8d2b5 100644 --- a/types.scm +++ b/types.scm @@ -241,11 +241,15 @@ ; 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. -- 2.43.5