m68k structure packing
Per Bothner
bothner@cygnus.com
Wed Oct 1 16:16:00 GMT 1997
> On the 68000 it takes 4 clocks for each bit shift, so in this code the
> shifts alone take up 64 clocks. I don't think the tradeoff is worth
> it here.
Nobody claims it is "worth" it. That is why byte-packing is not the
default. It is an option, because some people want/need byte-packing,
perhaps to be compatible with some other architecture. They are
willing to pay the price.
> Again it all depends. If you pack and use short accesses, then yes I
> would expect a SIGBUS error on the short load instruction. If you can
> pack it and the compiler can produce code that uses only byte
> accesses, then the bloated code will go dog slow but not SIGBUS.
Yep.
> If you want packed structures then they should be sized up to a short,
But then they wouldn't be packed, would they ...
Maybe what you are asking for is a "semi-packed" option.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner
More information about the Gcc
mailing list