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: m68k peephole weirdness


Paul Brook <paul@codesourcery.com> writes:

> In m68k.md we have:
>
> ;; Speed up pushing a single byte but leaving four bytes of space.
>
> (define_peephole
>   [(set (mem:QI (pre_dec:SI (reg:SI SP_REG)))
>         (match_operand:QI 1 "general_operand" "dami"))
>    (set (reg:SI SP_REG) (minus:SI (reg:SI SP_REG) (const_int 2)))]
>
>
> The (const_int 2) looks very suspect. Shouldn't this be (const_int 3) ?
> If not, could someone please explain to me what bit of arcane magic I'm 
> missing?

Pushing a byte will actually push a word, i.e "move.b x,-(%sp)" modifies
%sp by two, not one.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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