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]
Other format: [Raw text]

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


On Wed, 2004-03-17 at 04:17, Gunther Nikl wrote:
>   Why "ext%.w %0"? Shouldn't it be "ext%.w %2"? Then I don't understand
>   the "move%.l %2,%0 in the else case and the extbl after smi in the if
>   case.

If you actually look at the extendqidi2 pattern, it should make more
sense.  Otherwise, you are lacking context about what op0 and op2 are. 
Op2 is the low word of the result, which contains the original byte
sign-extended to a work.  op0 is the upper word, which contains only
sign-extension bits.  The sign extension bits can be generated by smi. 
We can either use smi and then extend it (if case), or we can move the
low word to the high word, and then replace the original byte in place
with sign-extend bits (else case) which gives an entire word of
sign-extend bits.  This assumes smi does a strict_low_part set, which is
a reasonable assumption for a m68k target.

But yes, I believe you are right about the ext%.w %0 in the else case.
It should be ext%.w %2.  This is a bug in the original code before
Richard Zidicky's patch, which then got replicated in a second place by
his patch.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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