2 struct bitmap_head_def;
3 typedef struct bitmap_head_def *bitmap;
4 typedef const struct bitmap_head_def *const_bitmap;
5 typedef unsigned long BITMAP_WORD;
7 typedef struct bitmap_obstack
9 struct bitmap_element_def *elements;
10 struct bitmap_head_def *heads;
11 struct obstack obstack;
13 typedef struct bitmap_element_def
15 struct bitmap_element_def *next;
16 struct bitmap_element_def *prev;
18 BITMAP_WORD bits[(2)];
21 struct bitmap_descriptor;
23 typedef struct bitmap_head_def {
24 bitmap_element *first;
25 bitmap_element *current;
27 bitmap_obstack *obstack;
30 bitmap_element bitmap_zero_bits;
40 static __attribute__((noinline)) void
41 bmp_iter_set_init (bitmap_iterator *bi, const_bitmap map,
42 unsigned start_bit, unsigned *bit_no)
44 bi->elt1 = map->first;
45 bi->elt2 = ((void *)0);
51 bi->elt1 = &bitmap_zero_bits;
55 if (bi->elt1->indx >= start_bit / (128u))
57 bi->elt1 = bi->elt1->next;
60 if (bi->elt1->indx != start_bit / (128u))
61 start_bit = bi->elt1->indx * (128u);
63 bi->word_no = start_bit / 64u % (2);
64 bi->bits = bi->elt1->bits[bi->word_no];
65 bi->bits >>= start_bit % 64u;
67 start_bit += !bi->bits;
72 static __inline__ __attribute__((always_inline)) void
73 bmp_iter_next (bitmap_iterator *bi, unsigned *bit_no)
79 static __inline__ __attribute__((always_inline)) unsigned char
80 bmp_iter_set (bitmap_iterator *bi, unsigned *bit_no)
84 while (!(bi->bits & 1))
92 *bit_no = ((*bit_no + 64u - 1) / 64u * 64u);
97 while (bi->word_no != (2))
99 bi->bits = bi->elt1->bits[bi->word_no];
102 while (!(bi->bits & 1))
113 bi->elt1 = bi->elt1->next;
116 *bit_no = bi->elt1->indx * (128u);
121 static void __attribute__((noinline))
122 foobar (bitmap_head *live_throughout)
126 for (bmp_iter_set_init (&(rsi), (live_throughout), (0), &(regno));
127 bmp_iter_set (&(rsi), &(regno));
128 bmp_iter_next (&(rsi), &(regno)))
133 bitmap_element elem = { (void *)0, (void *)0, 0, { 1, 1 } };
134 bitmap_head live_throughout = { &elem, &elem, 0, (void *)0 };
135 foobar (&live_throughout);