diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-06-07 13:12:01 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-06-07 17:31:01 -0400 |
commit | 5ad089a3c946aec655436fa3b0b50d6574b78197 (patch) | |
tree | 4f832709576103acddbc6dea927c4269611c2968 /gcc/bitmap.h | |
parent | 64735dc923e0a1a2e04c5313471d91ca8b954e9a (diff) | |
download | gcc-5ad089a3c946aec655436fa3b0b50d6574b78197.zip gcc-5ad089a3c946aec655436fa3b0b50d6574b78197.tar.gz gcc-5ad089a3c946aec655436fa3b0b50d6574b78197.tar.bz2 |
Implement multi-bit aligned accessors for sparse bitmap.
Provide set/get routines to allow sparse bitmaps to be treated as an array
of multiple bit values. Only chunk sizes that are powers of 2 are supported.
* bitmap.c (bitmap_set_aligned_chunk): New.
(bitmap_get_aligned_chunk): New.
(test_aligned_chunk): New.
(bitmap_c_tests): Call test_aligned_chunk.
* bitmap.h (bitmap_set_aligned_chunk, bitmap_get_aligned_chunk): New.
Diffstat (limited to 'gcc/bitmap.h')
-rw-r--r-- | gcc/bitmap.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/bitmap.h b/gcc/bitmap.h index 2613855..0846f79 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -438,6 +438,13 @@ extern bool bitmap_set_bit (bitmap, int); /* Return true if a bit is set in a bitmap. */ extern int bitmap_bit_p (const_bitmap, int); +/* Set and get multiple bit values in a sparse bitmap. This allows a bitmap to + function as a sparse array of bit patterns where the patterns are + multiples of power of 2. This is more efficient than performing this as + multiple individual operations. */ +void bitmap_set_aligned_chunk (bitmap, unsigned int, unsigned int, BITMAP_WORD); +BITMAP_WORD bitmap_get_aligned_chunk (const_bitmap, unsigned int, unsigned int); + /* Debug functions to print a bitmap. */ extern void debug_bitmap (const_bitmap); extern void debug_bitmap_file (FILE *, const_bitmap); |