1 /* Variable array bitsets.
2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009 Free Software
4 Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 /* This file implements variable size bitsets stored as a variable
27 length array of words. Any unused bits in the last word must be
30 Note that binary or ternary operations assume that each bitset operand
34 static void vbitset_unused_clear (bitset
);
36 static void vbitset_set (bitset
, bitset_bindex
);
37 static void vbitset_reset (bitset
, bitset_bindex
);
38 static bool vbitset_test (bitset
, bitset_bindex
);
39 static bitset_bindex
vbitset_list (bitset
, bitset_bindex
*,
40 bitset_bindex
, bitset_bindex
*);
41 static bitset_bindex
vbitset_list_reverse (bitset
, bitset_bindex
*,
42 bitset_bindex
, bitset_bindex
*);
44 #define VBITSET_N_WORDS(N) (((N) + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
45 #define VBITSET_WORDS(X) ((X)->b.cdata)
46 #define VBITSET_SIZE(X) ((X)->b.csize)
47 #define VBITSET_ASIZE(X) ((X)->v.size)
51 #define min(a, b) ((a) > (b) ? (b) : (a))
52 #define max(a, b) ((a) > (b) ? (a) : (b))
55 vbitset_resize (bitset src
, bitset_bindex n_bits
)
57 bitset_windex oldsize
;
58 bitset_windex newsize
;
60 if (n_bits
== BITSET_NBITS_ (src
))
63 oldsize
= VBITSET_SIZE (src
);
64 newsize
= VBITSET_N_WORDS (n_bits
);
66 if (oldsize
< newsize
)
70 /* The bitset needs to grow. If we already have enough memory
71 allocated, then just zero what we need. */
72 if (newsize
> VBITSET_ASIZE (src
))
74 /* We need to allocate more memory. When oldsize is
75 non-zero this means that we are changing the size, so
76 grow the bitset 25% larger than requested to reduce
77 number of reallocations. */
82 size
= newsize
+ newsize
/ 4;
85 = realloc (VBITSET_WORDS (src
), size
* sizeof (bitset_word
));
86 VBITSET_ASIZE (src
) = size
;
89 memset (VBITSET_WORDS (src
) + oldsize
, 0,
90 (newsize
- oldsize
) * sizeof (bitset_word
));
91 VBITSET_SIZE (src
) = newsize
;
95 /* The bitset needs to shrink. There's no point deallocating
96 the memory unless it is shrinking by a reasonable amount. */
97 if ((oldsize
- newsize
) >= oldsize
/ 2)
100 = realloc (VBITSET_WORDS (src
), newsize
* sizeof (bitset_word
));
101 VBITSET_ASIZE (src
) = newsize
;
104 /* Need to prune any excess bits. FIXME. */
106 VBITSET_SIZE (src
) = newsize
;
109 BITSET_NBITS_ (src
) = n_bits
;
114 /* Set bit BITNO in bitset DST. */
116 vbitset_set (dst
, bitno
)
120 bitset_windex windex
= bitno
/ BITSET_WORD_BITS
;
122 /* Perhaps we should abort. The user should explicitly call
123 bitset_resize since this will not catch the case when we set a
124 bit larger than the current size but smaller than the allocated
126 vbitset_resize (dst
, bitno
);
128 dst
->b
.cdata
[windex
- dst
->b
.cindex
] |=
129 (bitset_word
) 1 << (bitno
% BITSET_WORD_BITS
);
133 /* Reset bit BITNO in bitset DST. */
135 vbitset_reset (dst
, bitno
)
136 bitset dst ATTRIBUTE_UNUSED
;
137 bitset_bindex bitno ATTRIBUTE_UNUSED
;
139 /* We must be accessing outside the cache so the bit is
144 /* Test bit BITNO in bitset SRC. */
146 vbitset_test (src
, bitno
)
147 bitset src ATTRIBUTE_UNUSED
;
148 bitset_bindex bitno ATTRIBUTE_UNUSED
;
150 /* We must be accessing outside the cache so the bit is
156 /* Find list of up to NUM bits set in BSET in reverse order, starting
157 from and including NEXT and store in array LIST. Return with
158 actual number of bits found and with *NEXT indicating where search
161 vbitset_list_reverse (src
, list
, num
, next
)
168 bitset_bindex rbitno
;
170 bitset_windex windex
;
172 bitset_bindex bitoff
;
173 bitset_word
*srcp
= VBITSET_WORDS (src
);
174 bitset_bindex n_bits
= BITSET_SIZE_ (src
);
178 /* If num is 1, we could speed things up with a binary search
179 of the word of interest. */
181 if (rbitno
>= n_bits
)
186 bitno
= n_bits
- (rbitno
+ 1);
188 windex
= bitno
/ BITSET_WORD_BITS
;
189 bitcnt
= bitno
% BITSET_WORD_BITS
;
190 bitoff
= windex
* BITSET_WORD_BITS
;
196 word
= srcp
[windex
] << (BITSET_WORD_BITS
- 1 - bitcnt
);
197 for (; word
; bitcnt
--)
199 if (word
& BITSET_MSB
)
201 list
[count
++] = bitoff
+ bitcnt
;
204 *next
= n_bits
- (bitoff
+ bitcnt
);
210 bitoff
-= BITSET_WORD_BITS
;
211 bitcnt
= BITSET_WORD_BITS
- 1;
215 *next
= n_bits
- (bitoff
+ 1);
220 /* Find list of up to NUM bits set in BSET starting from and including
221 *NEXT and store in array LIST. Return with actual number of bits
222 found and with *NEXT indicating where search stopped. */
224 vbitset_list (src
, list
, num
, next
)
232 bitset_windex windex
;
233 bitset_bindex bitoff
;
234 bitset_windex size
= VBITSET_SIZE (src
);
235 bitset_word
*srcp
= VBITSET_WORDS (src
);
243 /* Many bitsets are zero, so make this common case fast. */
244 for (windex
= 0; windex
< size
&& !srcp
[windex
]; windex
++)
249 /* If num is 1, we could speed things up with a binary search
250 of the current word. */
252 bitoff
= windex
* BITSET_WORD_BITS
;
256 if (bitno
>= BITSET_SIZE_ (src
))
259 windex
= bitno
/ BITSET_WORD_BITS
;
260 bitno
= bitno
% BITSET_WORD_BITS
;
264 /* Handle the case where we start within a word.
265 Most often, this is executed with large bitsets
266 with many set bits where we filled the array
267 on the previous call to this function. */
269 bitoff
= windex
* BITSET_WORD_BITS
;
270 word
= srcp
[windex
] >> bitno
;
271 for (bitno
= bitoff
+ bitno
; word
; bitno
++)
275 list
[count
++] = bitno
;
286 bitoff
= windex
* BITSET_WORD_BITS
;
289 for (; windex
< size
; windex
++, bitoff
+= BITSET_WORD_BITS
)
291 if (!(word
= srcp
[windex
]))
294 if ((count
+ BITSET_WORD_BITS
) < num
)
296 for (bitno
= bitoff
; word
; bitno
++)
299 list
[count
++] = bitno
;
305 for (bitno
= bitoff
; word
; bitno
++)
309 list
[count
++] = bitno
;
326 /* Ensure that any unused bits within the last word are clear. */
328 vbitset_unused_clear (dst
)
331 unsigned int last_bit
;
333 last_bit
= BITSET_SIZE_ (dst
) % BITSET_WORD_BITS
;
335 VBITSET_WORDS (dst
)[VBITSET_SIZE (dst
) - 1] &=
336 ((bitset_word
) 1 << last_bit
) - 1;
341 vbitset_ones (bitset dst
)
343 bitset_word
*dstp
= VBITSET_WORDS (dst
);
346 bytes
= sizeof (bitset_word
) * VBITSET_SIZE (dst
);
348 memset (dstp
, -1, bytes
);
349 vbitset_unused_clear (dst
);
354 vbitset_zero (bitset dst
)
356 bitset_word
*dstp
= VBITSET_WORDS (dst
);
359 bytes
= sizeof (bitset_word
) * VBITSET_SIZE (dst
);
361 memset (dstp
, 0, bytes
);
366 vbitset_empty_p (bitset dst
)
369 bitset_word
*dstp
= VBITSET_WORDS (dst
);
371 for (i
= 0; i
< VBITSET_SIZE (dst
); i
++)
380 vbitset_copy1 (bitset dst
, bitset src
)
390 vbitset_resize (dst
, BITSET_SIZE_ (src
));
392 srcp
= VBITSET_WORDS (src
);
393 dstp
= VBITSET_WORDS (dst
);
394 ssize
= VBITSET_SIZE (src
);
395 dsize
= VBITSET_SIZE (dst
);
397 memcpy (dstp
, srcp
, sizeof (bitset_word
) * ssize
);
399 memset (dstp
+ sizeof (bitset_word
) * ssize
, 0,
400 sizeof (bitset_word
) * (dsize
- ssize
));
405 vbitset_not (bitset dst
, bitset src
)
413 vbitset_resize (dst
, BITSET_SIZE_ (src
));
415 srcp
= VBITSET_WORDS (src
);
416 dstp
= VBITSET_WORDS (dst
);
417 ssize
= VBITSET_SIZE (src
);
418 dsize
= VBITSET_SIZE (dst
);
420 for (i
= 0; i
< ssize
; i
++)
421 *dstp
++ = ~(*srcp
++);
423 vbitset_unused_clear (dst
);
424 memset (dstp
+ sizeof (bitset_word
) * ssize
, 0,
425 sizeof (bitset_word
) * (dsize
- ssize
));
430 vbitset_equal_p (bitset dst
, bitset src
)
433 bitset_word
*srcp
= VBITSET_WORDS (src
);
434 bitset_word
*dstp
= VBITSET_WORDS (dst
);
435 bitset_windex ssize
= VBITSET_SIZE (src
);
436 bitset_windex dsize
= VBITSET_SIZE (dst
);
438 for (i
= 0; i
< min (ssize
, dsize
); i
++)
439 if (*srcp
++ != *dstp
++)
444 for (; i
< ssize
; i
++)
450 for (; i
< dsize
; i
++)
460 vbitset_subset_p (bitset dst
, bitset src
)
463 bitset_word
*srcp
= VBITSET_WORDS (src
);
464 bitset_word
*dstp
= VBITSET_WORDS (dst
);
465 bitset_windex ssize
= VBITSET_SIZE (src
);
466 bitset_windex dsize
= VBITSET_SIZE (dst
);
468 for (i
= 0; i
< min (ssize
, dsize
); i
++, dstp
++, srcp
++)
469 if (*dstp
!= (*srcp
| *dstp
))
474 for (; i
< ssize
; i
++)
484 vbitset_disjoint_p (bitset dst
, bitset src
)
487 bitset_word
*srcp
= VBITSET_WORDS (src
);
488 bitset_word
*dstp
= VBITSET_WORDS (dst
);
489 bitset_windex ssize
= VBITSET_SIZE (src
);
490 bitset_windex dsize
= VBITSET_SIZE (dst
);
492 for (i
= 0; i
< min (ssize
, dsize
); i
++)
493 if (*srcp
++ & *dstp
++)
501 vbitset_and (bitset dst
, bitset src1
, bitset src2
)
507 bitset_windex ssize1
;
508 bitset_windex ssize2
;
511 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
513 dsize
= VBITSET_SIZE (dst
);
514 ssize1
= VBITSET_SIZE (src1
);
515 ssize2
= VBITSET_SIZE (src2
);
516 dstp
= VBITSET_WORDS (dst
);
517 src1p
= VBITSET_WORDS (src1
);
518 src2p
= VBITSET_WORDS (src2
);
520 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
521 *dstp
++ = *src1p
++ & *src2p
++;
523 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- min (ssize1
, ssize2
)));
528 vbitset_and_cmp (bitset dst
, bitset src1
, bitset src2
)
535 bitset_windex ssize1
;
536 bitset_windex ssize2
;
539 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
541 dsize
= VBITSET_SIZE (dst
);
542 ssize1
= VBITSET_SIZE (src1
);
543 ssize2
= VBITSET_SIZE (src2
);
544 dstp
= VBITSET_WORDS (dst
);
545 src1p
= VBITSET_WORDS (src1
);
546 src2p
= VBITSET_WORDS (src2
);
548 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
550 bitset_word tmp
= *src1p
++ & *src2p
++;
565 for (; i
< ssize1
; i
++, dstp
++)
574 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
581 vbitset_andn (bitset dst
, bitset src1
, bitset src2
)
587 bitset_windex ssize1
;
588 bitset_windex ssize2
;
591 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
593 dsize
= VBITSET_SIZE (dst
);
594 ssize1
= VBITSET_SIZE (src1
);
595 ssize2
= VBITSET_SIZE (src2
);
596 dstp
= VBITSET_WORDS (dst
);
597 src1p
= VBITSET_WORDS (src1
);
598 src2p
= VBITSET_WORDS (src2
);
600 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
601 *dstp
++ = *src1p
++ & ~(*src2p
++);
605 for (; i
< ssize2
; i
++)
608 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize2
));
612 for (; i
< ssize1
; i
++)
615 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
621 vbitset_andn_cmp (bitset dst
, bitset src1
, bitset src2
)
628 bitset_windex ssize1
;
629 bitset_windex ssize2
;
632 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
634 dsize
= VBITSET_SIZE (dst
);
635 ssize1
= VBITSET_SIZE (src1
);
636 ssize2
= VBITSET_SIZE (src2
);
637 dstp
= VBITSET_WORDS (dst
);
638 src1p
= VBITSET_WORDS (src1
);
639 src2p
= VBITSET_WORDS (src2
);
641 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
643 bitset_word tmp
= *src1p
++ & ~(*src2p
++);
654 for (; i
< ssize2
; i
++, dstp
++)
663 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize2
));
667 for (; i
< ssize1
; i
++, dstp
++)
669 bitset_word tmp
= *src1p
++;
678 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
686 vbitset_or (bitset dst
, bitset src1
, bitset src2
)
692 bitset_windex ssize1
;
693 bitset_windex ssize2
;
696 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
698 dsize
= VBITSET_SIZE (dst
);
699 ssize1
= VBITSET_SIZE (src1
);
700 ssize2
= VBITSET_SIZE (src2
);
701 dstp
= VBITSET_WORDS (dst
);
702 src1p
= VBITSET_WORDS (src1
);
703 src2p
= VBITSET_WORDS (src2
);
705 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
706 *dstp
++ = *src1p
++ | *src2p
++;
714 for (; i
< ssize1
; i
++)
717 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
722 vbitset_or_cmp (bitset dst
, bitset src1
, bitset src2
)
729 bitset_windex ssize1
;
730 bitset_windex ssize2
;
733 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
735 dsize
= VBITSET_SIZE (dst
);
736 ssize1
= VBITSET_SIZE (src1
);
737 ssize2
= VBITSET_SIZE (src2
);
738 dstp
= VBITSET_WORDS (dst
);
739 src1p
= VBITSET_WORDS (src1
);
740 src2p
= VBITSET_WORDS (src2
);
742 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
744 bitset_word tmp
= *src1p
++ | *src2p
++;
759 for (; i
< ssize1
; i
++, dstp
++)
761 bitset_word tmp
= *src1p
++;
770 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
777 vbitset_xor (bitset dst
, bitset src1
, bitset src2
)
783 bitset_windex ssize1
;
784 bitset_windex ssize2
;
787 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
789 dsize
= VBITSET_SIZE (dst
);
790 ssize1
= VBITSET_SIZE (src1
);
791 ssize2
= VBITSET_SIZE (src2
);
792 dstp
= VBITSET_WORDS (dst
);
793 src1p
= VBITSET_WORDS (src1
);
794 src2p
= VBITSET_WORDS (src2
);
796 for (i
= 0; i
< min (ssize1
, ssize2
); i
++)
797 *dstp
++ = *src1p
++ ^ *src2p
++;
805 for (; i
< ssize1
; i
++)
808 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
813 vbitset_xor_cmp (bitset dst
, bitset src1
, bitset src2
)
820 bitset_windex ssize1
;
821 bitset_windex ssize2
;
824 vbitset_resize (dst
, max (BITSET_SIZE_ (src1
), BITSET_SIZE_ (src2
)));
826 dsize
= VBITSET_SIZE (dst
);
827 ssize1
= VBITSET_SIZE (src1
);
828 ssize2
= VBITSET_SIZE (src2
);
829 dstp
= VBITSET_WORDS (dst
);
830 src1p
= VBITSET_WORDS (src1
);
831 src2p
= VBITSET_WORDS (src2
);
833 for (i
= 0; i
< min (ssize1
, ssize2
); i
++, dstp
++)
835 bitset_word tmp
= *src1p
++ ^ *src2p
++;
850 for (; i
< ssize1
; i
++, dstp
++)
852 bitset_word tmp
= *src1p
++;
861 memset (dstp
, 0, sizeof (bitset_word
) * (dsize
- ssize1
));
867 /* FIXME, these operations need fixing for different size
871 vbitset_and_or (bitset dst
, bitset src1
, bitset src2
, bitset src3
)
880 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
881 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
883 bitset_and_or_ (dst
, src1
, src2
, src3
);
887 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
889 src1p
= VBITSET_WORDS (src1
);
890 src2p
= VBITSET_WORDS (src2
);
891 src3p
= VBITSET_WORDS (src3
);
892 dstp
= VBITSET_WORDS (dst
);
893 size
= VBITSET_SIZE (dst
);
895 for (i
= 0; i
< size
; i
++)
896 *dstp
++ = (*src1p
++ & *src2p
++) | *src3p
++;
901 vbitset_and_or_cmp (bitset dst
, bitset src1
, bitset src2
, bitset src3
)
911 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
912 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
913 return bitset_and_or_cmp_ (dst
, src1
, src2
, src3
);
915 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
917 src1p
= VBITSET_WORDS (src1
);
918 src2p
= VBITSET_WORDS (src2
);
919 src3p
= VBITSET_WORDS (src3
);
920 dstp
= VBITSET_WORDS (dst
);
921 size
= VBITSET_SIZE (dst
);
923 for (i
= 0; i
< size
; i
++, dstp
++)
925 bitset_word tmp
= (*src1p
++ & *src2p
++) | *src3p
++;
938 vbitset_andn_or (bitset dst
, bitset src1
, bitset src2
, bitset src3
)
947 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
948 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
950 bitset_andn_or_ (dst
, src1
, src2
, src3
);
954 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
956 src1p
= VBITSET_WORDS (src1
);
957 src2p
= VBITSET_WORDS (src2
);
958 src3p
= VBITSET_WORDS (src3
);
959 dstp
= VBITSET_WORDS (dst
);
960 size
= VBITSET_SIZE (dst
);
962 for (i
= 0; i
< size
; i
++)
963 *dstp
++ = (*src1p
++ & ~(*src2p
++)) | *src3p
++;
968 vbitset_andn_or_cmp (bitset dst
, bitset src1
, bitset src2
, bitset src3
)
978 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
979 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
980 return bitset_andn_or_cmp_ (dst
, src1
, src2
, src3
);
982 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
984 src1p
= VBITSET_WORDS (src1
);
985 src2p
= VBITSET_WORDS (src2
);
986 src3p
= VBITSET_WORDS (src3
);
987 dstp
= VBITSET_WORDS (dst
);
988 size
= VBITSET_SIZE (dst
);
990 for (i
= 0; i
< size
; i
++, dstp
++)
992 bitset_word tmp
= (*src1p
++ & ~(*src2p
++)) | *src3p
++;
1005 vbitset_or_and (bitset dst
, bitset src1
, bitset src2
, bitset src3
)
1014 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
1015 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
1017 bitset_or_and_ (dst
, src1
, src2
, src3
);
1021 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
1023 src1p
= VBITSET_WORDS (src1
);
1024 src2p
= VBITSET_WORDS (src2
);
1025 src3p
= VBITSET_WORDS (src3
);
1026 dstp
= VBITSET_WORDS (dst
);
1027 size
= VBITSET_SIZE (dst
);
1029 for (i
= 0; i
< size
; i
++)
1030 *dstp
++ = (*src1p
++ | *src2p
++) & *src3p
++;
1035 vbitset_or_and_cmp (bitset dst
, bitset src1
, bitset src2
, bitset src3
)
1045 if (BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src2
)
1046 || BITSET_NBITS_ (src1
) != BITSET_NBITS_ (src3
))
1047 return bitset_or_and_cmp_ (dst
, src1
, src2
, src3
);
1049 vbitset_resize (dst
, BITSET_NBITS_ (src1
));
1051 src1p
= VBITSET_WORDS (src1
);
1052 src2p
= VBITSET_WORDS (src2
);
1053 src3p
= VBITSET_WORDS (src3
);
1054 dstp
= VBITSET_WORDS (dst
);
1055 size
= VBITSET_SIZE (dst
);
1057 for (i
= 0; i
< size
; i
++, dstp
++)
1059 bitset_word tmp
= (*src1p
++ | *src2p
++) & *src3p
++;
1072 vbitset_copy (bitset dst
, bitset src
)
1074 if (BITSET_COMPATIBLE_ (dst
, src
))
1075 vbitset_copy1 (dst
, src
);
1077 bitset_copy_ (dst
, src
);
1081 /* Vector of operations for multiple word bitsets. */
1082 struct bitset_vtable vbitset_vtable
= {
1109 vbitset_andn_or_cmp
,
1113 vbitset_list_reverse
,
1120 vbitset_bytes (n_bits
)
1121 bitset_bindex n_bits ATTRIBUTE_UNUSED
;
1123 return sizeof (struct vbitset_struct
);
1128 vbitset_init (bset
, n_bits
)
1130 bitset_bindex n_bits
;
1132 bset
->b
.vtable
= &vbitset_vtable
;
1136 VBITSET_SIZE (bset
) = 0;
1137 vbitset_resize (bset
, n_bits
);