This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [bitmap]: tidy and remove unused function


On Mon, Nov 08, 2004 at 05:32:55PM +0000, Nathan Sidwell wrote:
> 	* bitmap.h (nBITMAP_WORD_BITS): Remove.
> 	(BITMAP_WORD_BITS): Force unsigned by use of 1u.
> 	(BITMAP_ELEMENT_WORDS, BITMAP_ELEMENT_ALL_BITS): Remove
> 	unnecessary casts.
> 	(bitmap_first_set_bit): Return unsigned.
> 	(bitmap_last_set_bit): Remove.
> 	* bitmap.c (bitmap_element_zerop, bitmap_copy): Make iterator
> 	unsigned.
> 	(bitmap_first_set_bit): Return unsigned, require non-empty bitmap,
> 	remove special case code for two word elements.
> 	(bitmap_last_set_bit): Remove.
> 	* ra-build.c (livethrough_conflicts_bb): Replace unnecessary use of
> 	bitmap_first_set_bit with bitmap_empty_p.
> 	* tree-outof-ssa.c (analyze_edges_for_bb): Likewise.
> 	* tree-ssa-pre.c (bitmap_print_value): Use simple flag rather than
> 	bitmap_last_bit_set.

Ok.

>     /* Binary search for the first set bit.  */
>     /* ??? It'd be nice to know if ffs or ffsl was available.  */

Given that you know that word is non-zero,

#ifdef GCC_VERSION >= 3004
  gcc_assert (sizeof (word) == sizeof(unsigned long));
  bit_num += __builtin_ctzl (word);
#else
  ...
#endif


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]