* mips inline asm question
@ 2003-09-24 6:04 黒津 基弥
2003-09-24 6:22 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: 黒津 基弥 @ 2003-09-24 6:04 UTC (permalink / raw)
To: linux-mips
Hi, all;
The following code is from
linux-2.4.20/include/asm-mips/mipsregs.h.
Could anyone tell how the difference between %z0 ("Jr")
and %0 ("r") is?
I compiled this code and deassemble the object, but I
can't find any
difference with my toolchains(gcc-2.95.3, binutils-2.11).
static inline void set_context(unsigned long val)
{
__asm__ __volatile__(
".set push\n\t"
".set reorder\n\t"
"mtc0 %z0, $4\n\t"
".set pop"
: : "Jr" (val));
}
Thanks in advance
mips4700
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: mips inline asm question
2003-09-24 6:04 mips inline asm question 黒津 基弥
@ 2003-09-24 6:22 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2003-09-24 6:22 UTC (permalink / raw)
To: ?$B9uDE ?$B4pLo; +Cc: linux-mips
On Wed, Sep 24, 2003 at 03:04:56PM +0900, ?$B9uDE ?$B4pLo wrote:
> The following code is from
> linux-2.4.20/include/asm-mips/mipsregs.h.
> Could anyone tell how the difference between %z0 ("Jr")
> and %0 ("r") is?
> I compiled this code and deassemble the object, but I
> can't find any
> difference with my toolchains(gcc-2.95.3, binutils-2.11).
>
> static inline void set_context(unsigned long val)
> {
> __asm__ __volatile__(
> ".set push\n\t"
> ".set reorder\n\t"
> "mtc0 %z0, $4\n\t"
> ".set pop"
> : : "Jr" (val));
> }
%z0 is just like %0 except if %0 has the value of 0 the compiler will insert
register $0. "Jr" mean the compiler can either use a register or the
constant zero. Both combined mean the compiler will not waste a real
register but use $zero.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-24 6:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-24 6:04 mips inline asm question 黒津 基弥
2003-09-24 6:22 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox