[rz@linux-m68k.org: Re: m68k, extendqidi2 problem]

Jim Wilson wilson@specifixinc.com
Wed Mar 17 23:22:00 GMT 2004


On Wed, 2004-03-17 at 14:11, Richard Zidlicky wrote:
> ..  makes more sense to me. The "move.l %2,%0" will set or clear upper 24
> bits, smi the lower 8 bits of the high word register. Pure curiosity, why
> isn't the same trick used in the 68020 branch?

Looking at gcc-2.7, we see that it was first
  if (TARGET_68020)
    return \"move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0\";
  else
    return \"move%.b %1,%2\;ext%.w %0\;ext%.l %2\;smi %0\;ext%.w
%0\;ext%.l %0\\";
and then between between 2.7 and 2.8 the non-68020 case was optimized to
delete one instruction by using this trick.  Not clear when exactly this
happened, just by looking at the ChangeLogs.

Perhaps the 68020 case was left alone to avoid the risk of breaking it. 
Or maybe it was left alone because smi/ext is a lot easier to understand
than movl/smi.

Your revised pattern looks right to me.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list