Fix make-array transforms.
[sbcl.git] / src / compiler / bit-util.lisp
1 ;;;; bit-vector hacking utilities, potentially implementation-dependent
2 ;;;; for speed
3
4 ;;;; This software is part of the SBCL system. See the README file for
5 ;;;; more information.
6 ;;;;
7 ;;;; This software is derived from the CMU CL system, which was
8 ;;;; written at Carnegie Mellon University and released into the
9 ;;;; public domain. The software is in the public domain and is
10 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
11 ;;;; files for more information.
12
13 (in-package "SB!C")
14
15 #!-sb-fluid
16 (declaim (inline clear-bit-vector set-bit-vector bit-vector-replace
17                  bit-vector-copy))
18
19 ;;; Clear a SIMPLE-BIT-VECTOR to zeros.
20 (defun clear-bit-vector (vec)
21   (declare (type simple-bit-vector vec))
22   (fill vec 0))
23
24 ;;; Fill a bit vector with ones.
25 (defun set-bit-vector (vec)
26   (declare (type simple-bit-vector vec))
27   (fill vec 1))
28
29 ;;; Replace the bits in To with the bits in From.
30 (defun bit-vector-replace (to from)
31   (declare (type simple-bit-vector to from))
32   (replace to from))
33
34 ;;; Copy a bit-vector.
35 (defun bit-vector-copy (vec)
36   (declare (type simple-bit-vector vec))
37   (copy-seq vec))