linux-mips
[Top] [All Lists]

Re: Strange instruction

To: "Kevin D. Kissell" <kevink@mips.com>
Subject: Re: Strange instruction
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Date: Thu, 14 Oct 2004 14:12:42 +0200
Cc: Dmitriy Tochansky <toch@dfpost.ru>, linux-mips@linux-mips.org
In-reply-to: <01d901c4b1c8$996b7b30$10eca8c0@grendel>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20041014115304.3edbe141.toch@dfpost.ru> <01d901c4b1c8$996b7b30$10eca8c0@grendel>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.6i
Kevin D. Kissell wrote:
> That's a 64-bit add, which is actually being used as a 64-bit move
> of the "sp" register to k1.  Try "objdump -m mips:isa64" (or whatever
> variant gives your version of objdump the right to disassemble the
> MIPS III+/MIPS64 instructions.
> 
> One might suspect that your board monitor ROM was built for a 64-bit CPU.
> This illustrates why, if one want to write portable assembler code for MIPS,
> one should implement "move" operations as OR Target,$0,Source rather than
> using an ADDU or DADDU...

GNU as has "move" as builtin macro which is expanded differently for
32 and 64 bit mode. This simplifies the task of writing code for both
models. Unfortunately the expansion was broken for a while and
generated always the 64 bit version if the toolchain was 64bit
_capable_. IIRC this was fixed in the early 2.14 timeframe.


Thiemo

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