From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geoff Keating To: Franz.Sirl-kernel@lauterbach.com Cc: dxs@pt.com, gcc@gcc.gnu.org Subject: Re: PowerPC code generation Date: Wed, 05 Jul 2000 14:36:00 -0000 Message-id: <200007052136.OAA01260@localhost.cygnus.com> References: <"Wed,> <5> <2000> <14:47:53> <-0400> <4.3.2.7.2.20000705224335.00d84780@mail.lauterbach.com> X-SW-Source: 2000-07/msg00081.html > Date: Wed, 05 Jul 2000 22:52:45 +0200 > From: Franz Sirl > 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