Commit 07309d58 by Uros Bizjak Committed by Jan Hubicka

* bitmap.c (bitmap_clear_bit): Micro optimize.

From-SVN: r161189
parent b0256cb6
2010-06-22 Uros Bizjak <ubizjak@gmail.com> 2010-06-22 Uros Bizjak <ubizjak@gmail.com>
* bitmap.c (bitmap_clear_bit): Micro optimize.
2010-06-22 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (SWI1248x): New mode iterator. * config/i386/i386.md (SWI1248x): New mode iterator.
(SWI48x): Ditto. (SWI48x): Ditto.
(SWI12): Ditto. (SWI12): Ditto.
......
...@@ -624,11 +624,13 @@ bitmap_clear_bit (bitmap head, int bit) ...@@ -624,11 +624,13 @@ bitmap_clear_bit (bitmap head, int bit)
BITMAP_WORD bit_val = ((BITMAP_WORD) 1) << bit_num; BITMAP_WORD bit_val = ((BITMAP_WORD) 1) << bit_num;
bool res = (ptr->bits[word_num] & bit_val) != 0; bool res = (ptr->bits[word_num] & bit_val) != 0;
if (res) if (res)
ptr->bits[word_num] &= ~bit_val; {
ptr->bits[word_num] &= ~bit_val;
/* If we cleared the entire word, free up the element. */ /* If we cleared the entire word, free up the element. */
if (bitmap_element_zerop (ptr)) if (!ptr->bits[word_num]
bitmap_element_free (head, ptr); && bitmap_element_zerop (ptr))
bitmap_element_free (head, ptr);
}
return res; return res;
} }
......
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