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: PowerPC code generation


> Date: Wed, 05 Jul 2000 22:52:45 +0200
> From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>

> Just out of interest, if I would implement __attribute__((little_endian)) 
> and __attribute__((big_endian)) for MEM's, basically the major work would 
> be to create something like a "revmovsi" pattern in the .md and tell 
> compiler how to use it, or? Which pass of the compiler would be responsible 
> for that? reload?

You'd probably make the front-end generate code which just does a
load followed by a bit-reversal (eg. 

unsigned tmp1 = foo->x
tmp2 = (tmp1 << 24) | (tmp1 >> 24) | (tmp1 >> 8 & 0x0000FF00) 
       | (tmp1 << 8 & 0x00FF0000)

and then have combine turn this into a single pattern which does the
load and bit reversal simultaneously.

So there are two jobs:  first, implement the __attribute__ stuff;
then, make it use the nifty instructions.  The first part is the more
tedious, but easier part, and it'd probably be useful to many people.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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