Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: ?$B9uDE ?$B4pLo <mips4700@yahoo.co.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: mips inline asm question
Date: Tue, 23 Sep 2003 23:22:09 -0700	[thread overview]
Message-ID: <20030924062209.GA24923@linux-mips.org> (raw)
In-Reply-To: <20030924060456.11903.qmail@web2307.mail.yahoo.co.jp>

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

      reply	other threads:[~2003-09-24  6:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-24  6:04 mips inline asm question 黒津 基弥
2003-09-24  6:22 ` Ralf Baechle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030924062209.GA24923@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mips4700@yahoo.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox