Re: HELP: MIPS PC Relative Addressing

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

 



On Thu, 25 Feb 2021, Jiaxun Yang wrote:

> > > I'll take this approach first, add "lla, dlla" pseudo-instructions to
> > > assembler and seeking optimization
> > > in future.
> > 
> >  The DLA and LA macros are supposed to do that already, no need to invent 
> > new names.
> 
> Hmm, how could we tell if the symbol is local?
> Global symbols still needs to be load from GOT.

 Just do what all the other MIPS/GAS macros do in this situation.  GAS 
knows whether a given symbol is local or external.

> I saw RISC-V dealt that by “lla” pesudo-op which indicate the symbol is local.

 But RISC-V is not MIPS.  Despite the similarities in the ISA its assembly 
language and psABI conventions are subtly different throughout.

> > > Btw I found we don't have any document for MIPS pseudo-instructions. RISC-V
> > > put them in ISA manual
> > > but it is not the case for MIPS. Is it possible to have one in binutils?
> > 
> >  There are MIPS assembly language books available; I'm fairly sure Dominic 
> > Sweetman's "See MIPS Run" has a chapter (I don't have the book at hand).  
> > I don't think GNU binutils documentation is supposed to describe the 
> > assembly dialects supported, except maybe for GNU extensions (pseudo-ops).
> 
> Yeah I saw See MIPS Run, but it's not a mandatory specification.
> Without a specification we may have different implementation across 
> toolchains and trouble users.

 I do not oppose a normative document, though there are ISAs for which 
several independently developed assembly dialects exist (e.g. x86).

 Traditionally GAS was meant as an assembler solely for GCC output, so it 
used to be adapted as a need arose.  Having a formal specification would 
hinder such quick adaptation.  I think we need to weigh pros and cons 
carefully.

 NB most macros date back to the IRIX if not MIPSCO compiler.  Semantics 
has been documented in books and is pretty straightforward to apply in a 
mechanical manner to new machine instructions that need macroisation.

  Maciej



[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux