Source-Changes archive

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

Re: CVS commit: src/sys/lib/libsa



David Laight wrote:
> I've found out which change make the code bloat...
> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/fs/msdosfs/bpb.h.diff?r1=1.4&r2=1.5&f=h
> 
> It seems gcc generates better code for:
>       a[0] + (a[1] << 8) + (a[2] << 16) + (a[3] << 24)
> than for:
>       a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)
> 
> However the code really needs:
>       #if (BYTE_ORDER == LITTLE_ENDIAN) && defined(UNALIGNED_ACCESS)
> to be true...

Why can't GCC figure out that much itself? Also why does code like this exist in
so many places? These should be static inline functions, not macros. I suggested
peek/poke functions before.

-- 
Christian



Home | Main Index | Thread Index | Old Index