acp = rzalloc_array(mem_ctx, struct acp_entry *, num_acp);
- bitset_words = ALIGN(num_acp, BITSET_WORDBITS) / BITSET_WORDBITS;
+ bitset_words = BITSET_WORDS(num_acp);
int next_acp = 0;
for (int b = 0; b < cfg->num_blocks; b++) {
num_vars = v->virtual_grf_count;
bd = rzalloc_array(mem_ctx, struct block_data, cfg->num_blocks);
- bitset_words = (ALIGN(v->virtual_grf_count, BITSET_WORDBITS) /
- BITSET_WORDBITS);
+ bitset_words = BITSET_WORDS(v->virtual_grf_count);
for (int i = 0; i < cfg->num_blocks; i++) {
bd[i].def = rzalloc_array(mem_ctx, BITSET_WORD, bitset_words);
bd[i].use = rzalloc_array(mem_ctx, BITSET_WORD, bitset_words);
/* bitset declarations
*/
-#define BITSET_DECLARE(name, size) \
- BITSET_WORD name[((size) + BITSET_WORDBITS - 1) / BITSET_WORDBITS]
+#define BITSET_WORDS(bits) (ALIGN(bits, BITSET_WORDBITS) / BITSET_WORDBITS)
+#define BITSET_DECLARE(name, bits) BITSET_WORD name[BITSET_WORDS(bits)]
/* bitset operations
*/
g->stack = rzalloc_array(g, unsigned int, count);
for (i = 0; i < count; i++) {
- int bitset_count = ALIGN(count, BITSET_WORDBITS) / BITSET_WORDBITS;
+ int bitset_count = BITSET_WORDS(count);
g->nodes[i].adjacency = rzalloc_array(g, BITSET_WORD, bitset_count);
g->nodes[i].adjacency_list_size = 4;