X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Farray-tran.lisp;h=9b0612ef0cab930b3b99cae74dcc692a12c95ed6;hb=88439f4753b11506772bac003ca43c4687a75e26;hp=a3c5ab5c7478b6906b70bdf813199dc6beef16e9;hpb=d1eb2bf63d127e8b022a19611ed503fd37ae77af;p=sbcl.git diff --git a/src/compiler/array-tran.lisp b/src/compiler/array-tran.lisp index a3c5ab5..9b0612e 100644 --- a/src/compiler/array-tran.lisp +++ b/src/compiler/array-tran.lisp @@ -119,7 +119,7 @@ (define hairy-data-vector-ref/check-bounds) (define data-vector-ref)) -#!+x86 +#!+(or x86 x86-64) (defoptimizer (data-vector-ref-with-offset derive-type) ((array index offset)) (extract-upgraded-element-type array)) @@ -130,7 +130,7 @@ (define hairy-data-vector-set/check-bounds) (define data-vector-set)) -#!+x86 +#!+(or x86 x86-64) (defoptimizer (data-vector-set-with-offset derive-type) ((array index offset new-value)) (assert-new-value-type new-value array)) @@ -666,10 +666,23 @@ :node node :policy (> speed space)) "inline non-SIMPLE-vector-handling logic" - (let ((element-type (upgraded-element-type-specifier-or-give-up array))) - `(%with-array-data-macro array start end - :unsafe? ,(policy node (= safety 0)) - :element-type ,element-type))) + (let ((element-type (upgraded-element-type-specifier-or-give-up array)) + (type (lvar-type array))) + (if (and (array-type-p type) + (listp (array-type-dimensions type)) + (not (null (cdr (array-type-dimensions type))))) + ;; If it's a simple multidimensional array, then just return its + ;; data vector directly rather than going through + ;; %WITH-ARRAY-DATA-MACRO. SBCL doesn't generally generate code + ;; that would use this currently, but we have encouraged users + ;; to use WITH-ARRAY-DATA and we may use it ourselves at some + ;; point in the future for optimized libraries or similar. + `(let ((data (truly-the (simple-array ,element-type (*)) + (%array-data-vector array)))) + (values data 0 (length data) 0)) + `(%with-array-data-macro array start end + :unsafe? ,(policy node (= safety 0)) + :element-type ,element-type)))) ;;;; array accessors