Commit a2b709cc by Jan Hubicka Committed by Jan Hubicka

bitmap.c (bitmap_and): Walk array forward.

	* bitmap.c (bitmap_and): Walk array forward.
	(bitmap_and_compl_into): Likewise.
	(bitmap_xor): Likewise.
	(bitmap_xor_into):  Likewise.
	(bitmap_equal_p): Likewise.
	(bitmap_intersect_p): Likewise.
	(bitmap_intersect_compl_p): Likewise.
	(bitmap_ior_and_into): Likewise.
	(bitmap_elt_copy): Likewise.
	(bitmap_and_compl): Likewise.
	(bitmap_elt_ior): Likewise.

From-SVN: r160502
parent d2081406
2010-06-09 Jan Hubicka <jh@suse.cz>
* bitmap.c (bitmap_and): Walk array forward.
(bitmap_and_compl_into): Likewise.
(bitmap_xor): Likewise.
(bitmap_xor_into): Likewise.
(bitmap_equal_p): Likewise.
(bitmap_intersect_p): Likewise.
(bitmap_intersect_compl_p): Likewise.
(bitmap_ior_and_into): Likewise.
(bitmap_elt_copy): Likewise.
(bitmap_and_compl): Likewise.
(bitmap_elt_ior): Likewise.
2010-06-09 Dave Korn <dave.korn.cygwin@gmail.com> 2010-06-09 Dave Korn <dave.korn.cygwin@gmail.com>
* opts-common.c (prune_options): Ensure replacement argv array * opts-common.c (prune_options): Ensure replacement argv array
......
...@@ -908,7 +908,7 @@ bitmap_and (bitmap dst, const_bitmap a, const_bitmap b) ...@@ -908,7 +908,7 @@ bitmap_and (bitmap dst, const_bitmap a, const_bitmap b)
dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx);
else else
dst_elt->indx = a_elt->indx; dst_elt->indx = a_elt->indx;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix];
...@@ -960,7 +960,7 @@ bitmap_and_into (bitmap a, const_bitmap b) ...@@ -960,7 +960,7 @@ bitmap_and_into (bitmap a, const_bitmap b)
unsigned ix; unsigned ix;
BITMAP_WORD ior = 0; BITMAP_WORD ior = 0;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] & b_elt->bits[ix];
...@@ -992,7 +992,7 @@ bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, ...@@ -992,7 +992,7 @@ bitmap_elt_copy (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
{ {
unsigned ix; unsigned ix;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (src_elt->bits[ix] != dst_elt->bits[ix]) if (src_elt->bits[ix] != dst_elt->bits[ix])
{ {
dst_elt->bits[ix] = src_elt->bits[ix]; dst_elt->bits[ix] = src_elt->bits[ix];
...@@ -1056,7 +1056,7 @@ bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b) ...@@ -1056,7 +1056,7 @@ bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b)
if (!changed && dst_elt && dst_elt->indx == a_elt->indx) if (!changed && dst_elt && dst_elt->indx == a_elt->indx)
{ {
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
...@@ -1082,7 +1082,7 @@ bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b) ...@@ -1082,7 +1082,7 @@ bitmap_and_compl (bitmap dst, const_bitmap a, const_bitmap b)
new_element = false; new_element = false;
} }
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
...@@ -1159,7 +1159,7 @@ bitmap_and_compl_into (bitmap a, const_bitmap b) ...@@ -1159,7 +1159,7 @@ bitmap_and_compl_into (bitmap a, const_bitmap b)
unsigned ix; unsigned ix;
BITMAP_WORD ior = 0; BITMAP_WORD ior = 0;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix]; BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
BITMAP_WORD r = a_elt->bits[ix] ^ cleared; BITMAP_WORD r = a_elt->bits[ix] ^ cleared;
...@@ -1453,7 +1453,7 @@ bitmap_compl_and_into (bitmap a, const_bitmap b) ...@@ -1453,7 +1453,7 @@ bitmap_compl_and_into (bitmap a, const_bitmap b)
unsigned ix; unsigned ix;
BITMAP_WORD ior = 0; BITMAP_WORD ior = 0;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix]; BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
BITMAP_WORD r = b_elt->bits[ix] ^ cleared; BITMAP_WORD r = b_elt->bits[ix] ^ cleared;
...@@ -1494,7 +1494,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, ...@@ -1494,7 +1494,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
if (!changed && dst_elt && dst_elt->indx == a_elt->indx) if (!changed && dst_elt && dst_elt->indx == a_elt->indx)
{ {
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix];
if (r != dst_elt->bits[ix]) if (r != dst_elt->bits[ix])
...@@ -1511,7 +1511,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev, ...@@ -1511,7 +1511,7 @@ bitmap_elt_ior (bitmap dst, bitmap_element *dst_elt, bitmap_element *dst_prev,
dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx);
else else
dst_elt->indx = a_elt->indx; dst_elt->indx = a_elt->indx;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] | b_elt->bits[ix];
dst_elt->bits[ix] = r; dst_elt->bits[ix] = r;
...@@ -1650,7 +1650,7 @@ bitmap_xor (bitmap dst, const_bitmap a, const_bitmap b) ...@@ -1650,7 +1650,7 @@ bitmap_xor (bitmap dst, const_bitmap a, const_bitmap b)
dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx); dst_elt = bitmap_elt_insert_after (dst, dst_prev, a_elt->indx);
else else
dst_elt->indx = a_elt->indx; dst_elt->indx = a_elt->indx;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix];
...@@ -1735,7 +1735,7 @@ bitmap_xor_into (bitmap a, const_bitmap b) ...@@ -1735,7 +1735,7 @@ bitmap_xor_into (bitmap a, const_bitmap b)
BITMAP_WORD ior = 0; BITMAP_WORD ior = 0;
bitmap_element *next = a_elt->next; bitmap_element *next = a_elt->next;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix]; BITMAP_WORD r = a_elt->bits[ix] ^ b_elt->bits[ix];
...@@ -1772,7 +1772,7 @@ bitmap_equal_p (const_bitmap a, const_bitmap b) ...@@ -1772,7 +1772,7 @@ bitmap_equal_p (const_bitmap a, const_bitmap b)
{ {
if (a_elt->indx != b_elt->indx) if (a_elt->indx != b_elt->indx)
return false; return false;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (a_elt->bits[ix] != b_elt->bits[ix]) if (a_elt->bits[ix] != b_elt->bits[ix])
return false; return false;
} }
...@@ -1797,7 +1797,7 @@ bitmap_intersect_p (const_bitmap a, const_bitmap b) ...@@ -1797,7 +1797,7 @@ bitmap_intersect_p (const_bitmap a, const_bitmap b)
b_elt = b_elt->next; b_elt = b_elt->next;
else else
{ {
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (a_elt->bits[ix] & b_elt->bits[ix]) if (a_elt->bits[ix] & b_elt->bits[ix])
return true; return true;
a_elt = a_elt->next; a_elt = a_elt->next;
...@@ -1824,7 +1824,7 @@ bitmap_intersect_compl_p (const_bitmap a, const_bitmap b) ...@@ -1824,7 +1824,7 @@ bitmap_intersect_compl_p (const_bitmap a, const_bitmap b)
b_elt = b_elt->next; b_elt = b_elt->next;
else else
{ {
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
if (a_elt->bits[ix] & ~b_elt->bits[ix]) if (a_elt->bits[ix] & ~b_elt->bits[ix])
return true; return true;
a_elt = a_elt->next; a_elt = a_elt->next;
...@@ -1880,7 +1880,7 @@ bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b, const_bitmap k ...@@ -1880,7 +1880,7 @@ bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b, const_bitmap k
BITMAP_WORD ior = 0; BITMAP_WORD ior = 0;
tmp_elt.indx = b_elt->indx; tmp_elt.indx = b_elt->indx;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
BITMAP_WORD r = b_elt->bits[ix] & ~kill_elt->bits[ix]; BITMAP_WORD r = b_elt->bits[ix] & ~kill_elt->bits[ix];
ior |= r; ior |= r;
...@@ -1998,7 +1998,7 @@ bitmap_ior_and_into (bitmap a, const_bitmap b, const_bitmap c) ...@@ -1998,7 +1998,7 @@ bitmap_ior_and_into (bitmap a, const_bitmap b, const_bitmap c)
overall = 0; overall = 0;
and_elt.indx = b_elt->indx; and_elt.indx = b_elt->indx;
for (ix = BITMAP_ELEMENT_WORDS; ix--;) for (ix = 0; ix < BITMAP_ELEMENT_WORDS; ix++)
{ {
and_elt.bits[ix] = b_elt->bits[ix] & c_elt->bits[ix]; and_elt.bits[ix] = b_elt->bits[ix] & c_elt->bits[ix];
overall |= and_elt.bits[ix]; overall |= and_elt.bits[ix];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment