Commit 6f0947e4 by Steven Bosscher Committed by Steven Bosscher

ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a loop to look for a…

ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a loop to look for a free slot in a page entry.

	* ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a
	loop to look for a free slot in a page entry.

From-SVN: r93738
parent f53d3f93
2005-01-16 Steven Bosscher <stevenb@suse.de>
* ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a
loop to look for a free slot in a page entry.
2005-01-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2005-01-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/16304 PR target/16304
......
...@@ -1139,8 +1139,14 @@ ggc_alloc_stat (size_t size MEM_STAT_DECL) ...@@ -1139,8 +1139,14 @@ ggc_alloc_stat (size_t size MEM_STAT_DECL)
word = bit = 0; word = bit = 0;
while (~entry->in_use_p[word] == 0) while (~entry->in_use_p[word] == 0)
++word; ++word;
#if GCC_VERSION >= 3004
bit = __builtin_ctzl (~entry->in_use_p[word]);
#else
while ((entry->in_use_p[word] >> bit) & 1) while ((entry->in_use_p[word] >> bit) & 1)
++bit; ++bit;
#endif
hint = word * HOST_BITS_PER_LONG + bit; hint = word * HOST_BITS_PER_LONG + bit;
} }
......
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