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

Re: mips64 assembler

David Daney a écrit :
> On 09/17/2010 01:44 PM, Camm Maguire wrote:
>> Greetings!
>> David Daney<ddaney@caviumnetworks.com>  writes:
>>> On 09/17/2010 07:16 AM, Camm Maguire wrote:
>>>> Greetings!  Is there anyway to load a known 64bit number into a given
>>>> register in two instructions?
>>> Not in the general case where the value of the 64-bit number is
>>> unconstrained...
>>>> Said number is guaranteed to be within
>>>> 32bits of the current value of another register.
>>> In other words, you want to add an arbitrary 32-bit constant to the
>>> value in a register.  You would need three instructions to do this.
>>> Two to generate the 32-bit constant and another to do the addition.
>>> David Daney.
>> Alas, this was as I had expected.  Perhaps you can suggest a course of
>> action.
>> On mips only, there is no plt support -- executables instead have
>> .MIPS.stubs entries for lazy relocations to external symbols.  Problem
>> is, these are only callable if the gp register is left at its
>> canonical position.  I need to load, relocate, and execute code which
>> might call these functions, which I currently redirect to the stub.
>> This means that any .got references to addresses in the code to be
>> relocated, which will of course not be in the global .got table, have
>> to be patched to immediate addressess, which on mips32 is easy
>> enough -- ld v0,oooo(gp) ->  lui v0,hhhh.  This won't work on mips64.
> PLT support works with the n32 ABI (with new toolchains).  Can you use that?

It actually works with all ABI.

Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

Reply to: