Skip to content
Commit 39f45fbe authored by Tom Rini's avatar Tom Rini
Browse files

fixdep: faster CONFIG_search



This is a port of dee81e988674 from Linux ("fixdep: faster CONFIG_
search") and posted by itself for ease of review.

To quote the kernel changelog:
"Do you think kernel build is 100% dominated by gcc? You are wrong!
One small utility called "fixdep" consistently manages to sneak into
profile's first page (unless you have small monitor of course).

The choke point is this clever code:

	for (; m < end; m++) {
		if (*m == INT_CONF) { p = (char *) m  ; goto conf; }
		if (*m == INT_ONFI) { p = (char *) m-1; goto conf; }
		if (*m == INT_NFIG) { p = (char *) m-2; goto conf; }
		if (*m == INT_FIG_) { p = (char *) m-3; goto conf; }

4 branches per 4 characters is not fast.

Use strstr(3), so that SSE2 etc can be used.

With this patch, fixdep is so deep at the bottom, it is hard to find
it."

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: default avatarTom Rini <trini@konsulko.com>
---
As part of working to re-sync our kbuild logic I see that fixdep.c
wasn't updated as part of the general resync with v4.17.  As this
specific change required some thinking to adapt our logic that was added
in 8be60f06 I am posting this change stand-alone for review.
parent f2a73d68
Loading
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment