[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [buildd] Etch?

On Sun, Aug 06, 2006 at 07:39:53PM +0200, Richard Zidlicky wrote:
> On Fri, Aug 04, 2006 at 02:37:03PM +0200, Geert Uytterhoeven wrote:
> > On Fri, 4 Aug 2006, Wouter Verhelst wrote:
> > > * Using address register indirect with predecrement or postincrement mode
> > >   on the stack pointer (A7) in byte context will increment resp.
> > >   decrement the stack pointer with 2 bytes on classic 68k, but with 1
> > >   byte on the ColdFire. Both still need to be aligned on two bytes,
> > >   however. As a result, this addressing mode should be avoided; but I do
> > >   not think that it is used very often.
> > 
> > Hmm... So what happens if you push 1 byte on the stack, and an
> > interrupt comes in?
> does CF have distinct user and supervisor stack pointers? 

It appears so. The ColdFire Programmer's Reference Guide, page 8-10,
describes an opcode "MOVE from USP", with "USP" meaning User Stack

The same page makes an exception for "a processor implementing ISA_A, or
[...] the MCF5407", both of which are of no relevance to us (we only
target the V4e core, since it's the only one with an MMU; the V4e core
is ISA_C).

> The push 1 byte to stack is not all that useless but can be avoided.
> Grepped through code and gcc doesn't do it, it is only used inside
> the kernel in 68040 FPU support routines afaics.

Right, but that's not an issue.

> I hope there is not more handwritten asm code with this oddity lurking

So do I. If it turns out to be used fairly often, it should
theoretically be possible to make gas barf on this particular addressing
mode, or to silently turn it into word context instead, or something
similar. We'll see.

Fun will now commence
  -- Seven Of Nine, "Ashes to Ashes", stardate 53679.4

Reply to: