/[cmucl]/src/compiler/array-tran.lisp
ViewVC logotype

Contents of /src/compiler/array-tran.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (hide annotations)
Sat Nov 1 22:58:26 1997 UTC (16 years, 5 months ago) by dtc
Branch: MAIN
Changes since 1.20: +5 -1 lines
Improved support for (complex single-float) and (complex double-float)
types. Adds storage classes to the backend for these so they can be
stored in registers or on the stack without consing; new primitive
types etc. Also adds (simple-array (complex {single,double}-float))
array types to avoid consing and speed vectors operations.  All
these changes are conditional on the :complex-float feature. More work
is needed to exploit these changes: improving the type dispatch in the
various function; maybe compiler transforms or more VOPs to handle
common functions inline.
1 wlott 1.1 ;;; -*- Package: C; Log: C.Log -*-
2     ;;;
3     ;;; **********************************************************************
4 ram 1.9 ;;; This code was written as part of the CMU Common Lisp project at
5     ;;; Carnegie Mellon University, and has been placed in the public domain.
6     ;;;
7     (ext:file-comment
8 dtc 1.21 "$Header: /tiger/var/lib/cvsroots/cmucl/src/compiler/array-tran.lisp,v 1.21 1997/11/01 22:58:26 dtc Exp $")
9 ram 1.9 ;;;
10 wlott 1.1 ;;; **********************************************************************
11     ;;;
12     ;;; This file contains array specific optimizers and transforms.
13     ;;;
14     ;;; Extracted from srctran and extended by William Lott.
15     ;;;
16     (in-package "C")
17    
18    
19     ;;;; Derive-Type Optimizers
20    
21 wlott 1.3 ;;; ASSERT-ARRAY-RANK -- internal
22 wlott 1.1 ;;;
23     ;;; Array operations that use a specific number of indices implicitly assert
24     ;;; that the array is of that rank.
25     ;;;
26 wlott 1.3 (defun assert-array-rank (array rank)
27     (assert-continuation-type
28 wlott 1.1 array
29     (specifier-type `(array * ,(make-list rank :initial-element '*)))))
30    
31     ;;; EXTRACT-ELEMENT-TYPE -- internal
32     ;;;
33     ;;; Array access functions return an object from the array, hence it's type
34     ;;; is going to be the array element type.
35     ;;;
36     (defun extract-element-type (array)
37     (let ((type (continuation-type array)))
38     (if (array-type-p type)
39     (array-type-element-type type)
40     *universal-type*)))
41    
42     ;;; ASSERT-NEW-VALUE-TYPE -- internal
43     ;;;
44     ;;; The ``new-value'' for array setters must fit in the array, and the
45     ;;; return type is going to be the same as the new-value for setf functions.
46     ;;;
47     (defun assert-new-value-type (new-value array)
48     (let ((type (continuation-type array)))
49     (when (array-type-p type)
50     (assert-continuation-type new-value (array-type-element-type type))))
51     (continuation-type new-value))
52    
53     ;;; Unsupplied-Or-NIL -- Internal
54     ;;;
55     ;;; Return true if Arg is NIL, or is a constant-continuation whose value is
56     ;;; NIL, false otherwise.
57     ;;;
58     (defun unsupplied-or-nil (arg)
59     (declare (type (or continuation null) arg))
60     (or (not arg)
61     (and (constant-continuation-p arg)
62     (not (continuation-value arg)))))
63    
64    
65     ;;; ARRAY-IN-BOUNDS-P -- derive-type optimizer.
66     ;;;
67     (defoptimizer (array-in-bounds-p derive-type) ((array &rest indices))
68     (assert-array-rank array (length indices))
69     *universal-type*)
70    
71     ;;; AREF -- derive-type optimizer.
72     ;;;
73     (defoptimizer (aref derive-type) ((array &rest indices))
74 wlott 1.4 (assert-array-rank array (length indices))
75 wlott 1.1 (extract-element-type array))
76    
77     ;;; %ASET -- derive-type optimizer.
78     ;;;
79     (defoptimizer (%aset derive-type) ((array &rest stuff))
80     (assert-array-rank array (1- (length stuff)))
81     (assert-new-value-type (car (last stuff)) array))
82    
83     ;;; DATA-VECTOR-REF -- derive-type optimizer.
84     ;;;
85     (defoptimizer (data-vector-ref derive-type) ((array index))
86     (extract-element-type array))
87    
88     ;;; DATA-VECTOR-SET -- derive-type optimizer.
89     ;;;
90     (defoptimizer (data-vector-set derive-type) ((array index new-value))
91     (assert-new-value-type new-value array))
92 ram 1.10
93     ;;; %WITH-ARRAY-DATA -- derive-type optimizer.
94     ;;;
95     ;;; Figure out the type of the data vector if we know the argument element
96     ;;; type.
97     ;;;
98     (defoptimizer (%with-array-data derive-type) ((array start end))
99     (let ((atype (continuation-type array)))
100     (when (array-type-p atype)
101     (values-specifier-type
102     `(values (simple-array ,(type-specifier
103     (array-type-element-type atype))
104     (*))
105     index index index)))))
106    
107 wlott 1.1
108     ;;; ARRAY-ROW-MAJOR-INDEX -- derive-type optimizer.
109     ;;;
110     (defoptimizer (array-row-major-index derive-type) ((array &rest indices))
111     (assert-array-rank array (length indices))
112     *universal-type*)
113    
114     ;;; ROW-MAJOR-AREF -- derive-type optimizer.
115     ;;;
116     (defoptimizer (row-major-aref derive-type) ((array index))
117     (extract-element-type array))
118    
119     ;;; %SET-ROW-MAJOR-AREF -- derive-type optimizer.
120     ;;;
121     (defoptimizer (%set-row-major-aref derive-type) ((array index new-value))
122     (assert-new-value-type new-value array))
123    
124     ;;; MAKE-ARRAY -- derive-type optimizer.
125     ;;;
126     (defoptimizer (make-array derive-type)
127     ((dims &key initial-element element-type initial-contents
128     adjustable fill-pointer displaced-index-offset displaced-to))
129 wlott 1.11 (let ((simple (and (unsupplied-or-nil adjustable)
130     (unsupplied-or-nil displaced-to)
131     (unsupplied-or-nil fill-pointer))))
132     (specifier-type
133     `(,(if simple 'simple-array 'array)
134     ,(cond ((not element-type) 't)
135     ((constant-continuation-p element-type)
136     (continuation-value element-type))
137     (t
138     '*))
139     ,(cond ((not simple)
140     '*)
141     ((constant-continuation-p dims)
142     (let ((val (continuation-value dims)))
143     (if (listp val) val (list val))))
144     ((csubtypep (continuation-type dims)
145     (specifier-type 'integer))
146     '(*))
147     (t
148     '*))))))
149 wlott 1.1
150    
151     ;;;; Constructors.
152    
153     ;;; VECTOR -- source-transform.
154     ;;;
155     ;;; Convert VECTOR into a make-array followed by setfs of all the elements.
156     ;;;
157     (def-source-transform vector (&rest elements)
158 ram 1.16 (if (byte-compiling)
159 ram 1.15 (values nil t)
160     (let ((len (length elements))
161     (n -1))
162     (once-only ((n-vec `(make-array ,len)))
163     `(progn
164     ,@(mapcar #'(lambda (el)
165     (once-only ((n-val el))
166     `(locally (declare (optimize (safety 0)))
167     (setf (svref ,n-vec ,(incf n))
168     ,n-val))))
169     elements)
170     ,n-vec)))))
171 wlott 1.1
172    
173     ;;; MAKE-STRING -- source-transform.
174     ;;;
175     ;;; Just convert it into a make-array.
176     ;;;
177     (def-source-transform make-string (length &key (initial-element #\NULL))
178 ram 1.16 (if (byte-compiling)
179 ram 1.15 (values nil t)
180     `(make-array (the index ,length)
181     :element-type 'base-char
182     :initial-element ,initial-element)))
183 wlott 1.1
184     (defconstant array-info
185 wlott 1.12 '((base-char #\NULL 8 vm:simple-string-type)
186 wlott 1.1 (single-float 0.0s0 32 vm:simple-array-single-float-type)
187     (double-float 0.0d0 64 vm:simple-array-double-float-type)
188     (bit 0 1 vm:simple-bit-vector-type)
189     ((unsigned-byte 2) 0 2 vm:simple-array-unsigned-byte-2-type)
190     ((unsigned-byte 4) 0 4 vm:simple-array-unsigned-byte-4-type)
191     ((unsigned-byte 8) 0 8 vm:simple-array-unsigned-byte-8-type)
192     ((unsigned-byte 16) 0 16 vm:simple-array-unsigned-byte-16-type)
193     ((unsigned-byte 32) 0 32 vm:simple-array-unsigned-byte-32-type)
194 dtc 1.19 #+signed-array ((signed-byte 8) 0 8 vm:simple-array-signed-byte-8-type)
195     #+signed-array ((signed-byte 16) 0 16 vm:simple-array-signed-byte-16-type)
196     #+signed-array ((signed-byte 30) 0 32 vm:simple-array-signed-byte-30-type)
197     #+signed-array ((signed-byte 32) 0 32 vm:simple-array-signed-byte-32-type)
198 dtc 1.21 #+complex-float ((complex single-float) #C(0.0s0 0.0s0) 64
199     vm:simple-array-complex-single-float-type)
200     #+complex-float ((complex double-float) #C(0.0d0 0.0d0) 128
201     vm:simple-array-complex-double-float-type)
202 wlott 1.1 (t 0 32 vm:simple-vector-type)))
203    
204     ;;; MAKE-ARRAY -- source-transform.
205     ;;;
206     ;;; The integer type restriction on the length assures that it will be a
207     ;;; vector. The lack of adjustable, fill-pointer, and displaced-to keywords
208     ;;; assures that it will be simple.
209     ;;;
210     (deftransform make-array ((length &key initial-element element-type)
211     (integer &rest *))
212     (let* ((eltype (cond ((not element-type) t)
213     ((not (constant-continuation-p element-type))
214     (give-up "Element-Type is not constant."))
215     (t
216     (continuation-value element-type))))
217     (len (if (constant-continuation-p length)
218     (continuation-value length)
219     '*))
220     (spec `(simple-array ,eltype (,len)))
221     (eltype-type (specifier-type eltype)))
222     (multiple-value-bind
223     (default-initial-element element-size typecode)
224     (dolist (info array-info
225     (give-up "Cannot open-code creation of ~S" spec))
226     (when (csubtypep eltype-type (specifier-type (car info)))
227     (return (values-list (cdr info)))))
228 wlott 1.6 (let* ((nwords-form
229     (if (>= element-size vm:word-bits)
230     `(* length ,(/ element-size vm:word-bits))
231     (let ((elements-per-word (/ 32 element-size)))
232     `(truncate (+ length
233     ,(if (eq 'vm:simple-string-type typecode)
234     elements-per-word
235     (1- elements-per-word)))
236     ,elements-per-word))))
237     (constructor
238     `(truly-the ,spec
239     (allocate-vector ,typecode length ,nwords-form))))
240 wlott 1.1 (values
241     (if (and default-initial-element
242     (or (null initial-element)
243     (and (constant-continuation-p initial-element)
244     (eql (continuation-value initial-element)
245     default-initial-element))))
246     constructor
247     `(truly-the ,spec (fill ,constructor initial-element)))
248     '((declare (type index length))))))))
249    
250     ;;; MAKE-ARRAY -- transform.
251     ;;;
252     ;;; The list type restriction does not assure that the result will be a
253     ;;; multi-dimensional array. But the lack of
254     ;;;
255     (deftransform make-array ((dims &key initial-element element-type)
256     (list &rest *))
257     (unless (or (null element-type) (constant-continuation-p element-type))
258     (give-up "Element-type not constant; cannot open code array creation"))
259     (unless (constant-continuation-p dims)
260     (give-up "Dimension list not constant; cannot open code array creation"))
261     (let ((dims (continuation-value dims)))
262     (unless (every #'integerp dims)
263 wlott 1.6 (give-up "Dimension list contains something other than an integer: ~S"
264 wlott 1.1 dims))
265     (if (= (length dims) 1)
266     `(make-array ',(car dims)
267     ,@(when initial-element
268     '(:initial-element initial-element))
269     ,@(when element-type
270     '(:element-type element-type)))
271     (let* ((total-size (reduce #'* dims))
272     (rank (length dims))
273     (spec `(simple-array
274     ,(cond ((null element-type) t)
275     ((constant-continuation-p element-type)
276     (continuation-value element-type))
277     (t '*))
278     ,(make-list rank :initial-element '*))))
279     `(let ((header (make-array-header vm:simple-array-type ,rank)))
280     (setf (%array-fill-pointer header) ,total-size)
281     (setf (%array-fill-pointer-p header) nil)
282     (setf (%array-available-elements header) ,total-size)
283     (setf (%array-data-vector header)
284     (make-array ,total-size
285     ,@(when element-type
286     '(:element-type element-type))
287     ,@(when initial-element
288     '(:initial-element initial-element))))
289     (setf (%array-displaced-p header) nil)
290     ,@(let ((axis -1))
291     (mapcar #'(lambda (dim)
292     `(setf (%array-dimension header ,(incf axis))
293     ,dim))
294     dims))
295     (truly-the ,spec header))))))
296    
297    
298     ;;;; Random properties of arrays.
299    
300     ;;; Transforms for various random array properties. If the property is know
301     ;;; at compile time because of a type spec, use that constant value.
302    
303     ;;; ARRAY-RANK -- transform.
304     ;;;
305     ;;; If we can tell the rank from the type info, use it instead.
306     ;;;
307     (deftransform array-rank ((array))
308     (let ((array-type (continuation-type array)))
309     (unless (array-type-p array-type)
310     (give-up))
311     (let ((dims (array-type-dimensions array-type)))
312     (if (not (listp dims))
313     (give-up "Array rank not known at compile time: ~S" dims)
314     (length dims)))))
315    
316     ;;; ARRAY-DIMENSION -- transform.
317     ;;;
318     ;;; If we know the dimensions at compile time, just use it. Otherwise, if
319     ;;; we can tell that the axis is in bounds, convert to %array-dimension
320     ;;; (which just indirects the array header) or length (if it's simple and a
321     ;;; vector).
322     ;;;
323     (deftransform array-dimension ((array axis)
324     (array index))
325     (unless (constant-continuation-p axis)
326     (give-up "Axis not constant."))
327     (let ((array-type (continuation-type array))
328     (axis (continuation-value axis)))
329     (unless (array-type-p array-type)
330     (give-up))
331     (let ((dims (array-type-dimensions array-type)))
332     (unless (listp dims)
333     (give-up
334     "Array dimensions unknown, must call array-dimension at runtime."))
335     (unless (> (length dims) axis)
336     (abort-transform "Array has dimensions ~S, ~D is too large."
337     dims axis))
338     (let ((dim (nth axis dims)))
339     (cond ((integerp dim)
340     dim)
341     ((= (length dims) 1)
342     (ecase (array-type-complexp array-type)
343     ((t)
344     '(%array-dimension array 0))
345     ((nil)
346     '(length array))
347     (*
348     (give-up "Can't tell if array is simple."))))
349     (t
350     '(%array-dimension array axis)))))))
351    
352     ;;; LENGTH -- transform.
353     ;;;
354     ;;; If the length has been declared and it's simple, just return it.
355     ;;;
356     (deftransform length ((vector)
357     ((simple-array * (*))))
358     (let ((type (continuation-type vector)))
359     (unless (array-type-p type)
360     (give-up))
361     (let ((dims (array-type-dimensions type)))
362     (unless (and (listp dims) (integerp (car dims)))
363     (give-up "Vector length unknown, must call length at runtime."))
364     (car dims))))
365    
366     ;;; LENGTH -- transform.
367     ;;;
368     ;;; All vectors can get their length by using vector-length. If it's simple,
369     ;;; it will extract the length slot from the vector. It it's complex, it will
370     ;;; extract the fill pointer slot from the array header.
371     ;;;
372     (deftransform length ((vector) (vector))
373     '(vector-length vector))
374    
375 ram 1.7
376     ;;; If a simple array with known dimensions, then vector-length is a
377     ;;; compile-time constant.
378     ;;;
379     (deftransform vector-length ((vector) ((simple-array * (*))))
380     (let ((vtype (continuation-type vector)))
381     (if (array-type-p vtype)
382     (let ((dim (first (array-type-dimensions vtype))))
383     (when (eq dim '*) (give-up))
384     dim)
385     (give-up))))
386    
387    
388 wlott 1.1 ;;; ARRAY-TOTAL-SIZE -- transform.
389     ;;;
390     ;;; Again, if we can tell the results from the type, just use it. Otherwise,
391     ;;; if we know the rank, convert into a computation based on array-dimension.
392     ;;; We can wrap a truly-the index around the multiplications because we know
393     ;;; that the total size must be an index.
394     ;;;
395     (deftransform array-total-size ((array)
396     (array))
397     (let ((array-type (continuation-type array)))
398     (unless (array-type-p array-type)
399     (give-up))
400     (let ((dims (array-type-dimensions array-type)))
401     (unless (listp dims)
402 wlott 1.2 (give-up "Can't tell the rank at compile time."))
403     (if (member '* dims)
404     (do ((form 1 `(truly-the index
405     (* (array-dimension array ,i) ,form)))
406     (i 0 (1+ i)))
407     ((= i (length dims)) form))
408     (reduce #'* dims)))))
409 wlott 1.1
410     ;;; ARRAY-HAS-FILL-POINTER-P -- transform.
411     ;;;
412     ;;; Only complex vectors have fill pointers.
413     ;;;
414     (deftransform array-has-fill-pointer-p ((array))
415     (let ((array-type (continuation-type array)))
416     (unless (array-type-p array-type)
417     (give-up))
418     (let ((dims (array-type-dimensions array-type)))
419     (if (and (listp dims) (not (= (length dims) 1)))
420     nil
421     (ecase (array-type-complexp array-type)
422     ((t)
423     t)
424     ((nil)
425     nil)
426     (*
427     (give-up "Array type ambiguous; must call ~
428     array-has-fill-pointer-p at runtime.")))))))
429    
430     ;;; %CHECK-BOUND -- transform.
431     ;;;
432     ;;; Primitive used to verify indicies into arrays. If we can tell at
433     ;;; compile-time or we are generating unsafe code, don't bother with the VOP.
434     ;;;
435     (deftransform %check-bound ((array dimension index))
436     (unless (constant-continuation-p dimension)
437     (give-up))
438     (let ((dim (continuation-value dimension)))
439     `(the (integer 0 ,dim) index)))
440     ;;;
441     (deftransform %check-bound ((array dimension index) * *
442     :policy (and (> speed safety) (= safety 0)))
443     'index)
444    
445    
446     ;;; WITH-ROW-MAJOR-INDEX -- internal.
447     ;;;
448     ;;; Handy macro for computing the row-major index given a set of indices. We
449     ;;; wrap each index with a call to %check-bound to assure that everything
450     ;;; works out correctly. We can wrap all the interior arith with truly-the
451     ;;; index because we know the the resultant row-major index must be an index.
452     ;;;
453     (eval-when (compile eval)
454     ;;;
455     (defmacro with-row-major-index ((array indices index &optional new-value)
456     &rest body)
457     `(let (n-indices dims)
458     (dotimes (i (length ,indices))
459     (push (make-symbol (format nil "INDEX-~D" i)) n-indices)
460     (push (make-symbol (format nil "DIM-~D" i)) dims))
461     (setf n-indices (nreverse n-indices))
462     (setf dims (nreverse dims))
463     `(lambda (,',array ,@n-indices ,@',(when new-value (list new-value)))
464     (let* (,@(let ((,index -1))
465     (mapcar #'(lambda (name)
466     `(,name (array-dimension ,',array
467     ,(incf ,index))))
468     dims))
469     (,',index
470     ,(if (null dims)
471     0
472     (do* ((dims dims (cdr dims))
473     (indices n-indices (cdr indices))
474     (last-dim nil (car dims))
475     (form `(%check-bound ,',array
476     ,(car dims)
477     ,(car indices))
478     `(truly-the index
479     (+ (truly-the index
480     (* ,form
481     ,last-dim))
482     (%check-bound
483     ,',array
484     ,(car dims)
485     ,(car indices))))))
486     ((null (cdr dims)) form)))))
487     ,',@body))))
488     ;;;
489     ); eval-when
490    
491     ;;; ARRAY-ROW-MAJOR-INDEX -- transform.
492     ;;;
493     ;;; Just return the index after computing it.
494     ;;;
495     (deftransform array-row-major-index ((array &rest indices))
496     (with-row-major-index (array indices index)
497     index))
498    
499    
500    
501     ;;;; Array accessors:
502    
503     ;;; SVREF, %SVSET, SCHAR, %SCHARSET, CHAR,
504     ;;; %CHARSET, SBIT, %SBITSET, BIT, %BITSET
505     ;;; -- source transforms.
506     ;;;
507     ;;; We convert all typed array accessors into aref and %aset with type
508     ;;; assertions on the array.
509     ;;;
510     (macrolet ((frob (reffer setter type)
511     `(progn
512     (def-source-transform ,reffer (a &rest i)
513 ram 1.16 (if (byte-compiling)
514 ram 1.15 (values nil t)
515     `(aref (the ,',type ,a) ,@i)))
516 wlott 1.1 (def-source-transform ,setter (a &rest i)
517 ram 1.16 (if (byte-compiling)
518 ram 1.15 (values nil t)
519     `(%aset (the ,',type ,a) ,@i))))))
520 wlott 1.1 (frob svref %svset simple-vector)
521     (frob schar %scharset simple-string)
522     (frob char %charset string)
523     (frob sbit %sbitset (simple-array bit))
524     (frob bit %bitset (array bit)))
525    
526     ;;; AREF, %ASET -- transform.
527     ;;;
528     ;;; Convert into a data-vector-ref (or set) with the set of indices replaced
529     ;;; with the an expression for the row major index.
530     ;;;
531     (deftransform aref ((array &rest indices))
532     (with-row-major-index (array indices index)
533     (data-vector-ref array index)))
534     ;;;
535     (deftransform %aset ((array &rest stuff))
536     (let ((indices (butlast stuff)))
537     (with-row-major-index (array indices index new-value)
538     (data-vector-set array index new-value))))
539    
540     ;;; ROW-MAJOR-AREF, %SET-ROW-MAJOR-AREF -- transform.
541     ;;;
542     ;;; Just convert into a data-vector-ref (or set) after checking that the
543     ;;; index is inside the array total size.
544     ;;;
545     (deftransform row-major-aref ((array index))
546     `(data-vector-ref array (%check-bound array (array-total-size array) index)))
547     ;;;
548     (deftransform %set-row-major-aref ((array index new-value))
549     `(data-vector-set array
550     (%check-bound array (array-total-size array) index)
551     new-value))
552 ram 1.7
553    
554     ;;;; Bit-vector array operation canonicalization:
555     ;;;
556     ;;; We convert all bit-vector operations to have the result array specified.
557     ;;; This allows any result allocation to be open-coded, and eliminates the need
558     ;;; for any VM-dependent transforms to handle these cases.
559    
560     (dolist (fun '(bit-and bit-ior bit-xor bit-eqv bit-nand bit-nor bit-andc1
561     bit-andc2 bit-orc1 bit-orc2))
562     ;;
563     ;; Make a result array if result is NIL or unsupplied.
564     (deftransform fun ((bit-array-1 bit-array-2 &optional result-bit-array)
565 ram 1.14 '(bit-vector bit-vector &optional null) '*
566 ram 1.7 :eval-name t :policy (>= speed space))
567     `(,fun bit-array-1 bit-array-2
568     (make-array (length bit-array-1) :element-type 'bit)))
569     ;;
570     ;; If result its T, make it the first arg.
571     (deftransform fun ((bit-array-1 bit-array-2 result-bit-array)
572 ram 1.14 '(bit-vector bit-vector (member t)) '*
573 ram 1.7 :eval-name t)
574     `(,fun bit-array-1 bit-array-2 bit-array-1)))
575    
576     ;;; Similar for BIT-NOT, but there is only one arg...
577     ;;;
578     (deftransform bit-not ((bit-array-1 &optional result-bit-array)
579     (bit-vector &optional null) *
580     :policy (>= speed space))
581     '(bit-not bit-array-1
582     (make-array (length bit-array-1) :element-type 'bit)))
583     ;;;
584     (deftransform bit-not ((bit-array-1 result-bit-array)
585     (bit-vector (constant-argument t)))
586 ram 1.17 '(bit-not bit-array-1 bit-array-1))
587 dtc 1.20
588    
589     ;;; ARRAY-HEADER-P -- transform.
590     ;;;
591     ;;; Pick off some constant cases.
592     ;;;
593     (deftransform array-header-p ((array) (array))
594     (let ((type (continuation-type array)))
595     (declare (optimize (safety 3)))
596     (unless (array-type-p type)
597     (give-up))
598     (let ((dims (array-type-dimensions type)))
599     (cond ((csubtypep type (specifier-type '(simple-array * (*))))
600     ;; No array header.
601     nil)
602     ((and (listp dims) (> (length dims) 1))
603     ;; Multi-dimensional array, will have a header.
604     t)
605     (t
606     (give-up))))))

  ViewVC Help
Powered by ViewVC 1.1.5