Changeset 5479


Ignore:
Timestamp:
Nov 5, 2006, 6:37:17 AM (18 years ago)
Author:
Gary Byers
Message:

%aref2, %aset2: call into kernel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-array.lisp

    r5389 r5479  
    576576                    (uvref data (the fixnum (+ offset rmi)))))))))))))
    577577
    578 (defun %2d-array-index (a x y)
    579   (let* ((dim0 (%svref a target::arrayH.dim0-cell))
    580          (dim1 (%svref a (1+ target::arrayH.dim0-cell))))
    581       (declare (fixnum dim0 dim1))
    582       (unless (and (typep x 'fixnum)
    583                    (>= (the fixnum x) 0)
    584                    (< (the fixnum x) dim0))
    585         (%err-disp $XARROOB x a))
    586       (unless (and (typep y 'fixnum)
    587                    (>= (the fixnum y) 0)
    588                    (< (the fixnum y) dim1))
    589         (%err-disp $XARROOB y a))
    590        (the fixnum (+ (the fixnum y) (the fixnum (* dim1 (the fixnum x)))))))
    591 
    592 (defun %aref2 (a x y)
    593   (let* ((a-type (typecode a)))
    594     (declare (fixnum a-type))
    595     (unless (>= a-type target::subtag-arrayH)
    596       (report-bad-arg a 'array))
    597     (unless (and (= a-type target::subtag-arrayH)
    598                  (= (the fixnum (%svref a target::arrayH.rank-cell)) 2))
    599       (%err-disp $XNDIMS a 2))
    600     (let* ((rmi (%2d-array-index a x y)))
    601       (declare (fixnum rmi))
    602       (multiple-value-bind (data offset) (%array-header-data-and-offset a)
    603         (declare (fixnum offset))
    604         (uvref data (the fixnum (+ rmi offset)))))))
     578
     579
     580
    605581
    606582(defun aset (a &lexpr subs&val)
     
    630606                        (setf (uvref data (the fixnum (+ offset rmi))) val)))))))))))))
    631607
    632 (defun %aset2 (a x y new)
    633   (let* ((a-type (typecode a)))
    634     (declare (fixnum a-type))
    635     (unless (>= a-type target::subtag-arrayH)
    636       (report-bad-arg a 'array))
    637     (unless (and (= a-type target::subtag-arrayH)
    638                  (= (the fixnum (%svref a target::arrayH.rank-cell)) 2))
    639       (%err-disp $XNDIMS a 2))
    640     (let* ((rmi (%2d-array-index a x y)))
    641       (declare (fixnum rmi))
    642       (multiple-value-bind (data offset) (%array-header-data-and-offset a)
    643         (declare (fixnum offset))
    644         (setf (uvref data (the fixnum (+ rmi offset))) new)))))
     608
    645609
    646610(defun schar (s i)
Note: See TracChangeset for help on using the changeset viewer.