From: Nathan F. <nf...@us...> - 2005-03-28 18:56:29
|
Update of /cvsroot/sbcl/sbcl/src/compiler/ppc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31074/src/compiler/ppc Modified Files: array.lisp insts.lisp Log Message: 0.8.21.5: Enable faster REPLACE on declared specialized arrays. Overview of necessary machinery: * New %VECTOR-RAW-BITS and %SET-VECTOR-RAW-BITS functions/VOPs which automatically take into account VECTOR-DATA-OFFSET (eliminates tedium associated with previous bit-bashing code and makes things slightly faster). It's not clear if the old %RAW-BITS and %SET-RAW-BITS functions need to remain; * Generalize the old bit-bashing code to generate bit-bashers for differently sized "bytes" (1-bit, 2-bit, 4-bit, etc.); * Add REPLACE transforms for most specialized array types (those with elements not larger than the word size); * Replace various incantations of COPY-FROM-SYSTEM-AREA, COPY-TO-SYSTEM-AREA, BIT-BASH-COPY, etc. with their new width-aware equivalents (this accounts for the bulk of the changed files, if not the changed lines); * Add systematic tests for UB*-BASH-{FILL,COPY}; * Add generalized SUBSEQ and COPY-SEQ transforms while we're at it (FILL would be nice to have, but is a little bit trickier to do in the general case). These changes also open up the possibility of removing %BYTE-BLT from the sources. Benefits: decrease in the number of WITHOUT-GCING forms required, less calling out to C, more of the system in Lisp, etc. %BYTE-BLT remains in this version, but may be removed if there is sufficient support for its removal. Index: array.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/ppc/array.lisp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- array.lisp 2 Nov 2004 08:37:55 -0000 1.8 +++ array.lisp 28 Mar 2005 18:55:06 -0000 1.9 @@ -534,7 +534,23 @@ (:result-types unsigned-num) (:variant 0 other-pointer-lowtag)) +(define-vop (vector-raw-bits word-index-ref) + (:note "vector-raw-bits VOP") + (:translate %vector-raw-bits) + (:results (value :scs (unsigned-reg))) + (:result-types unsigned-num) + (:variant vector-data-offset other-pointer-lowtag)) +(define-vop (set-vector-raw-bits word-index-set) + (:note "setf vector-raw-bits VOP") + (:translate %set-vector-raw-bits) + (:args (object :scs (descriptor-reg)) + (index :scs (any-reg zero immediate)) + (value :scs (unsigned-reg))) + (:arg-types * positive-fixnum unsigned-num) + (:results (result :scs (unsigned-reg))) + (:result-types unsigned-num) + (:variant vector-data-offset other-pointer-lowtag)) ;;;; Misc. Array VOPs. Index: insts.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/ppc/insts.lisp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- insts.lisp 19 Apr 2004 11:22:56 -0000 1.10 +++ insts.lisp 28 Mar 2005 18:55:07 -0000 1.11 @@ -232,10 +232,8 @@ (cond (length-only (values 0 (1+ length) nil nil)) (t - (sb!kernel:copy-from-system-area sap (* n-byte-bits (1+ offset)) - vector (* n-word-bits - vector-data-offset) - (* length n-byte-bits)) + (sb!kernel:copy-ub8-from-system-area sap (1+ offset) + vector 0 length) (collect ((sc-offsets) (lengths)) (lengths 1) ; the length byte |