Changeset 14559
- Timestamp:
- Jan 6, 2011, 4:55:02 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/compiler/optimizers.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/compiler/optimizers.lisp
r14372 r14559 584 584 585 585 (define-compiler-macro ldb (&whole call &environment env byte integer) 586 (cond ((and (integerp byte) (> byte 0)) 587 (let ((size (byte-size byte)) 588 (position (byte-position byte))) 589 (cond ((nx-form-typep integer 'fixnum env) 590 `(logand ,(byte-mask size) 591 (the fixnum (ash ,integer ,(- position))))) 592 (t `(load-byte ,size ,position ,integer))))) 593 ((and (consp byte) 594 (eq (%car byte) 'byte) 595 (eq (list-length (%cdr byte)) 2)) 596 (let ((size (%cadr byte)) 597 (position (%caddr byte))) 598 (if (and (nx-form-typep integer 'fixnum env) (fixnump position)) 599 ;; I'm not sure this is worth doing 600 `(logand (byte-mask ,size) (the fixnum (ash ,integer ,(- position)))) 601 ;; this IS worth doing 602 `(load-byte ,size ,position ,integer)))) 603 (t call))) 586 (cond ((and (integerp byte) (> byte 0)) 587 (let ((size (byte-size byte)) 588 (position (byte-position byte))) 589 (cond ((nx-form-typep integer 'fixnum env) 590 `(logand ,(byte-mask size) 591 (the fixnum (ash ,integer ,(- position))))) 592 ((zerop position) 593 `(logand ,(byte-mask size) ,integer)) 594 (t `(load-byte ,size ,position ,integer))))) 595 ((and (consp byte) 596 (eq (%car byte) 'byte) 597 (eq (list-length (%cdr byte)) 2)) 598 (let ((size (%cadr byte)) 599 (position (%caddr byte))) 600 (if (eql position 0) 601 `(logand (byte-mask ,size) ,integer) 602 (if (and (nx-form-typep integer 'fixnum env) (fixnump position)) 603 ;; I'm not sure this is worth doing 604 `(logand (byte-mask ,size) (the fixnum (ash ,integer ,(- position)))) 605 ;; this IS worth doing 606 `(load-byte ,size ,position ,integer))))) 607 (t call))) 604 608 605 609 (define-compiler-macro length (&whole call &environment env seq)
Note:
See TracChangeset
for help on using the changeset viewer.
