lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Problem With dns.c Using 32-Bit Compilers


From: Bill Auerbach
Subject: RE: [lwip-users] Problem With dns.c Using 32-Bit Compilers
Date: Thu, 28 Aug 2008 08:39:30 -0400

> > I agree too. Not to use packing would make the code bigger and all
> > compilers have packing, it just a problem of syntax.
> 
> In contrast, for most processors, the code gets bigger with structure
> packing! This is because the compiler doesn't know where e.g. (for a
> 32-bit processor) an U32 will be so it has to load every byte of it as
> a single load and combine the 4 bytes in one register. Compared to one
> single load instruction for a correctly aligned U32, this is much
> bigger!

Not all 32-bit processors are code-size affected by non-aligned reads and
writes.  PowerPC's and Intel processors for example use the same
instructions for aligned and non-aligned accesses.  The accesses may be
slower (quite possibly with caching it's negligible) but the program size
doesn't change.

Bill





reply via email to

[Prev in Thread] Current Thread [Next in Thread]