This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bitrange-overlap: Handle lsb0


(Question-marks removed to allude subject spam filter that trigs
for some reason -- overseers informed.  If you get this twice
this is the resend you should reply to.)

I just committed Doug Evans suggestion (and approval) in
<URL:http://sources.redhat.com/ml/cgen/2002-q2/msg00031.html>,
though I included myself in the ChangeLog entry so some of the
blame for any failure will fall on me.  I didn't notice I had
missed committing this patch until its absence caused a local
test-case to fail.  Mea culpa.

2002-10-08  Doug Evans  <dje@transmeta.com>
	    Hans-Peter Nilsson  <hp@axis.com>

	* types.scm (bitrange-overlap?): Handle lsb0?.

Index: types.scm
===================================================================
RCS file: /cvs/src/src/cgen/types.scm,v
retrieving revision 1.1.1.1
diff -p -c -r1.1.1.1 types.scm
*** types.scm	28 Jul 2000 04:11:52 -0000	1.1.1.1
--- types.scm	7 Oct 2002 23:28:29 -0000
***************
*** 241,251 ****
  ; 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))))
  )
  
  ; Return a boolean indicating if BITPOS is beyond bitrange START,LEN.
--- 241,255 ----
  ; Return a boolean indicating if two bitranges overlap.
  
  (define (bitrange-overlap? start1 length1 start2 length2 lsb0?)
!   (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.

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]