SSE intrinsics
[sbcl/pkhuong.git] / src / compiler / generic / vm-typetran.lisp
blob032823a43299e59c1e01e86679fdd83864c9aba6
1 ;;;; This file contains the implementation specific type
2 ;;;; transformation magic. Basically, the various non-standard
3 ;;;; predicates that can be used in TYPEP transformations.
5 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; more information.
7 ;;;;
8 ;;;; This software is derived from the CMU CL system, which was
9 ;;;; written at Carnegie Mellon University and released into the
10 ;;;; public domain. The software is in the public domain and is
11 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
12 ;;;; files for more information.
14 (in-package "SB!C")
16 ;;;; internal predicates
18 ;;; These type predicates are used to implement simple cases of TYPEP.
19 ;;; They shouldn't be used explicitly.
20 (define-type-predicate base-string-p base-string)
21 (define-type-predicate bignump bignum)
22 #!+sb-unicode (define-type-predicate character-string-p (vector character))
23 (define-type-predicate complex-double-float-p (complex double-float))
24 (define-type-predicate complex-single-float-p (complex single-float))
25 #!+long-float
26 (define-type-predicate complex-long-float-p (complex long-float))
27 ;;; (COMPLEX-VECTOR-P isn't here because it's not so much a Lisp-level
28 ;;; type predicate as just a hack to get at the type code so that we
29 ;;; can implement some primitive stuff in Lisp.)
30 (define-type-predicate double-float-p double-float)
31 (define-type-predicate fixnump fixnum)
32 (define-type-predicate long-float-p long-float)
33 (define-type-predicate ratiop ratio)
34 (define-type-predicate short-float-p short-float)
35 (define-type-predicate single-float-p single-float)
36 (define-type-predicate simple-array-p simple-array)
37 (define-type-predicate simple-array-nil-p (simple-array nil (*)))
38 (define-type-predicate simple-array-unsigned-byte-2-p
39 (simple-array (unsigned-byte 2) (*)))
40 (define-type-predicate simple-array-unsigned-byte-4-p
41 (simple-array (unsigned-byte 4) (*)))
42 (define-type-predicate simple-array-unsigned-byte-7-p
43 (simple-array (unsigned-byte 7) (*)))
44 (define-type-predicate simple-array-unsigned-byte-8-p
45 (simple-array (unsigned-byte 8) (*)))
46 (define-type-predicate simple-array-unsigned-byte-15-p
47 (simple-array (unsigned-byte 15) (*)))
48 (define-type-predicate simple-array-unsigned-byte-16-p
49 (simple-array (unsigned-byte 16) (*)))
50 #!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
51 (define-type-predicate simple-array-unsigned-byte-29-p
52 (simple-array (unsigned-byte 29) (*)))
53 (define-type-predicate simple-array-unsigned-byte-31-p
54 (simple-array (unsigned-byte 31) (*)))
55 (define-type-predicate simple-array-unsigned-byte-32-p
56 (simple-array (unsigned-byte 32) (*)))
57 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
58 (define-type-predicate simple-array-unsigned-byte-60-p
59 (simple-array (unsigned-byte 60) (*)))
60 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
61 (define-type-predicate simple-array-unsigned-byte-63-p
62 (simple-array (unsigned-byte 63) (*)))
63 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
64 (define-type-predicate simple-array-unsigned-byte-64-p
65 (simple-array (unsigned-byte 64) (*)))
66 (define-type-predicate simple-array-signed-byte-8-p
67 (simple-array (signed-byte 8) (*)))
68 (define-type-predicate simple-array-signed-byte-16-p
69 (simple-array (signed-byte 16) (*)))
70 #!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
71 (define-type-predicate simple-array-signed-byte-30-p
72 (simple-array (signed-byte 30) (*)))
73 (define-type-predicate simple-array-signed-byte-32-p
74 (simple-array (signed-byte 32) (*)))
75 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
76 (define-type-predicate simple-array-signed-byte-61-p
77 (simple-array (signed-byte 61) (*)))
78 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
79 (define-type-predicate simple-array-signed-byte-64-p
80 (simple-array (signed-byte 64) (*)))
81 (define-type-predicate simple-array-single-float-p
82 (simple-array single-float (*)))
83 (define-type-predicate simple-array-double-float-p
84 (simple-array double-float (*)))
85 #!+long-float
86 (define-type-predicate simple-array-long-float-p
87 (simple-array long-float (*)))
88 (define-type-predicate simple-array-complex-single-float-p
89 (simple-array (complex single-float) (*)))
90 (define-type-predicate simple-array-complex-double-float-p
91 (simple-array (complex double-float) (*)))
92 #!+long-float
93 (define-type-predicate simple-array-complex-long-float-p
94 (simple-array (complex long-float) (*)))
95 (define-type-predicate simple-base-string-p simple-base-string)
96 #!+sb-unicode (define-type-predicate simple-character-string-p
97 (simple-array character (*)))
98 (define-type-predicate system-area-pointer-p system-area-pointer)
99 #!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
100 (define-type-predicate unsigned-byte-32-p (unsigned-byte 32))
101 #!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
102 (define-type-predicate signed-byte-32-p (signed-byte 32))
103 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
104 (define-type-predicate unsigned-byte-64-p (unsigned-byte 64))
105 #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
106 (define-type-predicate signed-byte-64-p (signed-byte 64))
107 #!+x86-64
108 (define-type-predicate sse-pack-p sse-pack)
109 (define-type-predicate vector-nil-p (vector nil))
110 (define-type-predicate weak-pointer-p weak-pointer)
111 (define-type-predicate code-component-p code-component)
112 (define-type-predicate lra-p lra)
113 (define-type-predicate fdefn-p fdefn)
114 (macrolet
115 ((def ()
116 `(progn ,@(loop for (name spec) in *vector-without-complex-typecode-infos*
117 collect `(define-type-predicate ,name (vector ,spec))))))
118 (def))
119 ;;; Unlike the un-%'ed versions, these are true type predicates,
120 ;;; accepting any type object.
121 (define-type-predicate %standard-char-p standard-char)