This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Inefficient bitfield code generation


degger@fhm.edu wrote:
> Actually the rs6000 port of gcc is really bad when it
> comes to using the blazingly powerful rotate and mask
> instructions of the powerpc. 

Yeah, that would be nice, but I am really more worried about the extra
load and stores in the examples I showed.  The load will hang the CPU
on cache miss, and there are 2 stores, one word, one byte to the same
address than can also be pretty bad, and that happens on both PowerPC
and x86.  Actually, I am really impressed that gcc can optimize out
the load in

    *p = (*p &  255) | (a << 8);
    *p = (*p & ~255) | (b & 255);

That's better than the IBM compilers.  Too bad that it cannot do that
for bitfields.

Zoli


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]