[PATCH] debloat lash by 4.803725881571%

Bernhard Fischer rep.nop at aon.at
Wed Jun 21 03:57:32 PDT 2006


On Tue, Jun 20, 2006 at 06:14:57PM -0400, Rob Landley wrote:
>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.

Yes, it's only (vaguely) benefical on i386.
I want to revisit these is*() stuff after 1.2.0 is out of the door.
While i can see that we don't want to introduce the bb_iswhatever stuff,
i want to provide the corresponding macros/functions via platform.h, so
we can potentially undo the bloat these impose on us via libc. uClibc
don't need treatment (we can use the libc stuff there) while other
libc's do need treatment.


More information about the busybox mailing list