linux-mips-fnet
[Top] [All Lists]

Re: question about int-handler.S

To: linux-mips@fnet.fr
Subject: Re: question about int-handler.S
From: Mitchell Blank Jr <mitch@execpc.com>
Date: Tue, 13 Apr 1999 05:25:55 -0500
In-reply-to: <Pine.LNX.3.95.990413110143.315B-100000@skynet.csn.ul.ie>; from Dave Airlie on Tue, Apr 13, 1999 at 11:01:54AM +0100
References: <Pine.LNX.3.95.990413110143.315B-100000@skynet.csn.ul.ie>
Dave Airlie wrote:
> The piece of code below is from int-handler.S,
> on line 7 below (b find_int) does this jump unconditionally to find_int?
> because if it does what is the and for afterwards as surely it will never
> get processed... 

MIPS has something called a "branch delay slot".  The instruction
immediately following the branch always gets executed EVEN IF THE
BRANCH HAPPENS.  Basically, this improves pipeline efficiency
since you can set up for the branch while you are still doing useful
stuff.  Sometimes you have to put a NOP there because after producing
enough information for the branch to be decided theres no work left
to do.

Most modern processors do something like this behind your back.  On the
MIPS, it is explicit and you (or your compiler) has to manually decide
what to put there.

-Mitch

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