[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

16 bytes saving in i386 kernel and libc, libc_r



Hi,

by changing the following line

	rorw	$8,%ax

where ever it appears in
 * src/lib/libc/arch/i386/net/[hn]to[nh][ls].S
 * src/sys/lib/libkern/arch/i386/[hm]to[nh][ls].S
to

	xchgb	%ah,%al

you will get a total of 16 bytes smaller kernel and libc,
libc_r at no cost of speed (I checked with the intel manuals)
on all i386 architecture systems.

(Of course, bswap on 486+ is faster, but since our kernels are
designed to run on 80386 also, and we are usually low on spare
bytes on ramdisk kernels, I thought I could share this.)

-Thorsten
-- 
"Multiple exclamation marks", he went on, shaking his head, "are a sure
sign of a diseased mind."	-- Terry Pratchett in "Eric"