[PATCH] debloat lash by 4.803725881571%

Rob Landley rob at landley.net
Tue Jun 20 22:14:57 UTC 2006


On Tuesday 20 June 2006 4:51 pm, Rich Felker wrote:

> BTW a function call may be smaller for isalnum, but isalpha is so
> trivial that it should always be smaller as a macro:
>
> #define isalpha(x) (((unsigned)(x) | 0x20)-'a' < 26)
>
> Dunno about other archs but on i386 that should compile to 4
> instructions (or, sub, sub, j[cc]). If you don't care about rejecting
> out-of-range values make the cast (unsigned char) and the code should
> get even smaller.

Doing math with unsigned char is larger on arm than doing math with unsigned 
int.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list