linux-mips
[Top] [All Lists]

Re: bal instruction in gcc 3.x

To: Kishore K <hellokishore@gmail.com>
Subject: Re: bal instruction in gcc 3.x
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Wed, 20 Jul 2005 10:52:11 +0100 (BST)
Cc: Pete Popov <ppopov@embeddedalley.com>, Ralf Baechle <ralf@linux-mips.org>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
In-reply-to: <f07e6e05072002197b529b72@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <f07e6e05071909301c212ab4@mail.gmail.com> <20050719164427.GB8758@linux-mips.org> <f07e6e05071910194bab9b16@mail.gmail.com> <1121802786.7285.88.camel@localhost.localdomain> <Pine.LNX.4.61L.0507200955390.30702@blysk.ds.pg.gda.pl> <f07e6e05072002197b529b72@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On Wed, 20 Jul 2005, Kishore K wrote:

> On the other hand, if I replace 
> 
> bal jump_to_label   
> 
> by 
> 
> la t9, jump_to_label
> jalr t9
> 
> I don't see any warning. What could be the reason ?

 Implicit assumptions in the "jal" macro.

> Can you suggest, what should be done to make the code safe for
> building on 64 bit processor.

 In this case:

        dla     t9, jump_to_label
        jalr    t9

Though we actually have auxiliary macros to make the resulting code 
readable.  So in the end you should really use something like this:

#include <asm/asm.h>

        PTR_LA  t9, jump_to_label
        jalr    t9

letting the whole mess be hidden in headers.

  Maciej

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