> > 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



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to