From: Ralf Baechle <ralf@linux-mips.org>
To: Indigodfw <indigodfw@yahoo.com>
Cc: linux-mips@linux-mips.org
Subject: Re: question about memory constraint in atomic_add
Date: Wed, 18 Feb 2004 14:45:01 +0100 [thread overview]
Message-ID: <20040218134501.GA24330@linux-mips.org> (raw)
In-Reply-To: <20040214151152.80368.qmail@web9502.mail.yahoo.com>
On Sat, Feb 14, 2004 at 07:11:52AM -0800, Indigodfw wrote:
> 2. Result of (C expression) should go into %xyz
> register
> So v->counter goes into %1, IOW ll from an int!
>
> Does not make sense to me.
> Why does it work, What am I missing?
> I mean in general what is the expression for a m
> constraint ptr (because I want ptr to be in regiser)
> or *ptr (because I wanna tell compiler that *ptr is
> what gets changed)
"m" gives you *something* suitable to address a memory object; that isn't
necessarily a memory address. On MIPS it can't even be just an address
in a register because "m" constraints are used with loads and stores and
those only accept the offset(reg) addressing mode. If you want an address
use something like "r" (&v->counter), then lw reg,(%xxx).
Ralf
next prev parent reply other threads:[~2004-02-18 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-14 15:11 question about memory constraint in atomic_add Indigodfw
2004-02-18 13:45 ` Ralf Baechle [this message]
2004-02-19 0:11 ` Indigodfw
2004-02-19 18:18 ` Daniel Jacobowitz
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=20040218134501.GA24330@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=indigodfw@yahoo.com \
--cc=linux-mips@linux-mips.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.