(def-type-predicate-wrapper ratiop)
(def-type-predicate-wrapper realp)
(def-type-predicate-wrapper short-float-p)
- (def-type-predicate-wrapper simple-array-p)
- (def-type-predicate-wrapper simple-bit-vector-p)
- (def-type-predicate-wrapper simple-base-string-p)
- #!+sb-unicode (def-type-predicate-wrapper simple-character-string-p)
- (def-type-predicate-wrapper simple-string-p)
- (def-type-predicate-wrapper simple-vector-p)
(def-type-predicate-wrapper single-float-p)
- (def-type-predicate-wrapper stringp)
(def-type-predicate-wrapper %instancep)
(def-type-predicate-wrapper symbolp)
(def-type-predicate-wrapper system-area-pointer-p)
(def-type-predicate-wrapper weak-pointer-p)
- (def-type-predicate-wrapper vectorp)
- #!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
- (def-type-predicate-wrapper unsigned-byte-32-p)
#!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
- (def-type-predicate-wrapper signed-byte-32-p)
+ (progn
+ (def-type-predicate-wrapper unsigned-byte-32-p)
+ (def-type-predicate-wrapper signed-byte-32-p))
#!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
- (def-type-predicate-wrapper unsigned-byte-64-p)
- #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
- (def-type-predicate-wrapper signed-byte-64-p)
- (def-type-predicate-wrapper simple-array-nil-p)
- (def-type-predicate-wrapper simple-array-unsigned-byte-2-p)
- (def-type-predicate-wrapper simple-array-unsigned-byte-4-p)
- (def-type-predicate-wrapper simple-array-unsigned-byte-8-p)
- (def-type-predicate-wrapper simple-array-unsigned-byte-16-p)
- (def-type-predicate-wrapper simple-array-unsigned-byte-32-p)
- (def-type-predicate-wrapper simple-array-signed-byte-8-p)
- (def-type-predicate-wrapper simple-array-signed-byte-16-p)
- (def-type-predicate-wrapper simple-array-signed-byte-30-p)
- (def-type-predicate-wrapper simple-array-signed-byte-32-p)
- (def-type-predicate-wrapper simple-array-single-float-p)
- (def-type-predicate-wrapper simple-array-double-float-p)
- #!+long-float (def-type-predicate-wrapper simple-array-long-float-p)
- (def-type-predicate-wrapper simple-array-complex-single-float-p)
- (def-type-predicate-wrapper simple-array-complex-double-float-p)
- #!+long-float (def-type-predicate-wrapper simple-array-complex-long-float-p)
+ (progn
+ (def-type-predicate-wrapper unsigned-byte-64-p)
+ (def-type-predicate-wrapper signed-byte-64-p))
+ ;; Specialized array types
+ (macrolet ((saetp-defs ()
+ `(progn
+ ,@(map 'list
+ (lambda (saetp)
+ `(def-type-predicate-wrapper
+ ,(symbolicate (sb!vm:saetp-primitive-type-name saetp) "-P")))
+ sb!vm:*specialized-array-element-type-properties*))))
+ (saetp-defs))
+ ;; Other array types
+ (def-type-predicate-wrapper simple-array-p)
+ (def-type-predicate-wrapper simple-string-p)
+ (def-type-predicate-wrapper stringp)
+ (def-type-predicate-wrapper vectorp)
(def-type-predicate-wrapper vector-nil-p))
\f
;;; Return the specifier for the type of object. This is not simply
t))))
(ctu:assert-no-consing (funcall f))))
+(with-test (:name :array-type-predicates)
+ (dolist (et sb-kernel::*specialized-array-element-types*)
+ (when et
+ (let* ((v (make-array 3 :element-type et))
+ (fun (compile nil `(lambda ()
+ (list
+ (if (typep ,v '(simple-array ,et (*)))
+ :good
+ :bad)
+ (if (typep (elt ,v 0) '(simple-array ,et (*)))
+ :bad
+ :good))))))
+ (assert (equal '(:good :good) (funcall fun)))))))
+
(with-test (:name :truncate-float)
(let ((s (compile nil `(lambda (x)
(declare (single-float x))