diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2012-07-26 12:02:54 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2012-07-26 12:02:54 +0000 |
commit | 0263463dd114d7ea50230ae6c53e7031615b2ec8 (patch) | |
tree | b377f47b8511c1d1b93b64e5b37aef519af1940b /gcc/ebitmap.c | |
parent | 6b4496dbc3afe3f18aaf3fa6792995427194d685 (diff) | |
download | gcc-0263463dd114d7ea50230ae6c53e7031615b2ec8.zip gcc-0263463dd114d7ea50230ae6c53e7031615b2ec8.tar.gz gcc-0263463dd114d7ea50230ae6c53e7031615b2ec8.tar.bz2 |
bitmap.h: Add explanation of sparse set as linked-list bitmap.
* bitmap.h: Add explanation of sparse set as linked-list bitmap.
* sbitmap.h: Add explanation about non-sparse sets as simple bitmap.
(TEST_BIT): Make a static inline function for stronger type checking.
(SET_BIT): Don't handle sbitmaps with popcount.
(RESET_BIT): Likewise.
(SET_BIT_WITH_POPCOUNT): New, like SET_BIT but with popcount.
(RESET_BIT_WITH_POPCOUNT): New, like RESET_BIT but with popcount.
* ebitmap.c (ebitmap_clear_bit): Use SET_BIT_WITH_POPCOUNT and
RESET_BIT_WITH_POPCOUNT on wordmask bitmaps.
(ebitmap_set_bit, ebitmap_and_into, ebitmap_and, ebitmap_ior_into,
ebitmap_and_compl_into, ebitmap_and_compl): Likewise.
* sparseset.h: Add explanation of sparse set representation.
From-SVN: r189888
Diffstat (limited to 'gcc/ebitmap.c')
-rw-r--r-- | gcc/ebitmap.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ebitmap.c b/gcc/ebitmap.c index c57d141..977d4ef 100644 --- a/gcc/ebitmap.c +++ b/gcc/ebitmap.c @@ -1,5 +1,5 @@ /* Sparse array-based bitmaps. - Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007-2012 Free Software Foundation, Inc. Contributed by Daniel Berlin <dberlin@dberlin.org> This file is part of GCC. @@ -258,7 +258,7 @@ ebitmap_clear_bit (ebitmap map, unsigned int bit) map->cache = map->cache - 1; } - RESET_BIT (map->wordmask, wordindex); + RESET_BIT_WITH_POPCOUNT (map->wordmask, wordindex); memmove(&map->elts[eltwordindex], &map->elts[eltwordindex + 1], sizeof (EBITMAP_ELT_TYPE) * (map->numwords - eltwordindex)); @@ -293,7 +293,7 @@ ebitmap_set_bit (ebitmap map, unsigned int bit) unsigned long count; unsigned int i; - SET_BIT (map->wordmask, wordindex); + SET_BIT_WITH_POPCOUNT (map->wordmask, wordindex); count = sbitmap_popcount (map->wordmask, wordindex); gcc_assert (count <= map->numwords); @@ -449,7 +449,7 @@ ebitmap_and_into (ebitmap dst, ebitmap src) *dstplace = tmpword; } else - RESET_BIT (dst->wordmask, i); + RESET_BIT_WITH_POPCOUNT (dst->wordmask, i); } #ifdef EBITMAP_DEBUGGING { @@ -508,7 +508,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2) *dstplace = tmpword; } else - RESET_BIT (dst->wordmask, i); + RESET_BIT_WITH_POPCOUNT (dst->wordmask, i); } else if (src1hasword) src1eltindex++; @@ -624,7 +624,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src) { newarray [neweltindex++] = ebitmap_array_get (src, srceltindex++); gcc_assert (i < dst->wordmask->n_bits); - SET_BIT (dst->wordmask, i); + SET_BIT_WITH_POPCOUNT (dst->wordmask, i); changed |= true; } } @@ -825,7 +825,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src) *dstplace = tmpword; } else - RESET_BIT (dst->wordmask, i); + RESET_BIT_WITH_POPCOUNT (dst->wordmask, i); } else { @@ -904,7 +904,7 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2) newarray[neweltindex++] = tmpword; } else - RESET_BIT (tempmask, i); + RESET_BIT_WITH_POPCOUNT (tempmask, i); } else |