X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fearly-type.lisp;h=20f164293f76c8182e73159d6ac39784800e79b1;hb=829ced3e78a23ba153ba4db64e6ea6984c2313b6;hp=1b395f1830bda6c792b813412e607f5eb1e038dc;hpb=0b9304783ffb07853927ec7ab67378602d4f39b4;p=sbcl.git diff --git a/src/code/early-type.lisp b/src/code/early-type.lisp index 1b395f1..20f1642 100644 --- a/src/code/early-type.lisp +++ b/src/code/early-type.lisp @@ -533,6 +533,29 @@ (t (values min :maybe)))) ())) +;;; A SIMD-PACK-TYPE is used to represent a SIMD-PACK type. +#!+sb-simd-pack +(defstruct (simd-pack-type + (:include ctype (class-info (type-class-or-lose 'simd-pack))) + (:constructor %make-simd-pack-type (element-type)) + (:copier nil)) + (element-type (missing-arg) + :type (cons #||(member #.*simd-pack-element-types*) ||#) + :read-only t)) + +#!+sb-simd-pack +(defun make-simd-pack-type (element-type) + (aver (neq element-type *wild-type*)) + (if (eq element-type *empty-type*) + *empty-type* + (%make-simd-pack-type + (dolist (pack-type *simd-pack-element-types* + (error "~S element type must be a subtype of ~ + ~{~S~#[~;, or ~:;, ~]~}." + 'simd-pack *simd-pack-element-types*)) + (when (csubtypep element-type (specifier-type pack-type)) + (return (list pack-type))))))) + ;;;; type utilities