linux-mips
[Top] [All Lists]

Re: jump instruction in delay slot

To: Thomas Koeller <thomas.koeller@baslerweb.com>
Subject: Re: jump instruction in delay slot
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Date: Tue, 19 Oct 2004 16:25:37 +0200
Cc: Linux/MIPS Development <linux-mips@linux-mips.org>, Manish Lachwani <mlachwani@mvista.com>
In-reply-to: <200410191605.47543.thomas.koeller@baslerweb.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200410191605.47543.thomas.koeller@baslerweb.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.6i
Thomas Koeller wrote:
> Hi,
> 
> the following code snippet is from
> arch/mips/pmc-sierra/yosemite/irq-handler.S:
> 
> ll_duart_irq:
>               li      a0, 4
>               move    a1, sp
>               jal     do_IRQ
>               j       ret_from_irq
> 
> I wonder if this is correct. AFAIK, a jump instruction
> must not occupy the delay slot of another branch or
> jump instruction. Since the 'jal' returns to the first
> instruction after the delay slot, I would expect the
> effect of the 'j' instruction to be cancelled. Or
> is this some kind of trick I do not understand?

I guess this code has no preceeding ".set noreorder" directive.
By default, your friendly assembler handles delay slots for you. :-)


Thiemo

<Prev in Thread] Current Thread [Next in Thread>