public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Ashok.A" <ashok_kumar_ak@yahoo.com>
To: gcc@gcc.gnu.org, Jim Wilson <wilson@specifixinc.com>
Cc: ashok_kumar_ak@yahoo.com
Subject: Clarification Req: Regarding "memory" clobber for cache operation is required (?)
Date: Fri, 26 Mar 2004 13:34:00 -0000	[thread overview]
Message-ID: <20040326063407.20385.qmail@web12008.mail.yahoo.com> (raw)
In-Reply-To: <4047955F.6030502@specifixinc.com>

Hello,

Need one clarification regarding the issue given
below. Could you please clarify it? 

To invalidate a cache line, do we really need to
use "memory" clobber in inline asm?

Example: (for MIPS-III architecture) 

   asm ("cache 17, 0(%0)"
        : /* no outputs */
        : "r"(ptr));

Where, 'ptr' (pointer to unsigned char type) points
to base address of cache to be invalidated.

For this case, do we need "memory" clobber in the
inline asm? Or, anyway to specifiy appropriate 
memory constraints?

Expecting for yours response ...

Thanks,
Ashok

P.S: I have checked the linux source. Looks neither
     "memory" clobber nor any memory constraint is
     specified in inline asm for similar operations
     in linux source.

     
--- Jim Wilson <wilson@specifixinc.com> wrote:
> Ashok.A wrote:
> > I need clarification regarding the "+m"
> constraints.
> > I heard that "+m" constraints cannot be used
> > in "inline asm". Is it true?
> 
> Current sources will give a warning for both of your
> examples.  Neither 
> read-write "+" or matching "1" constraints should be
> used with mems in 
> an asm.  These both require that the operands are
> the same, but the 
> compiler is not able to guarantee this for mems.  We
> can only make this 
> work for register constraints.
> 
> Try changing the lw to use %2 instead of %1, and
> then use "m" for the 
> second operand.  I think this is the way it is
> supposed to work nowadays.
> -- 
> Jim Wilson, GNU Tools Support,
> http://www.SpecifixInc.com
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

  reply	other threads:[~2004-03-26  6:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-03 14:44 Clarification Req: Regarding "+m" constraints in inline asm Ashok.A
2004-03-04 20:45 ` Jim Wilson
2004-03-26 13:34   ` Ashok.A [this message]
2004-03-27 19:54     ` Clarification Req: Regarding "memory" clobber for cache operation is required (?) Ashok.A
2004-03-30  0:38     ` Jim Wilson
2004-03-30 21:26       ` Ashok.A
2004-03-30 22:02         ` Paul Koning
2004-03-31  9:40           ` Ashok.A
2004-03-31  1:45       ` Richard Henderson

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=20040326063407.20385.qmail@web12008.mail.yahoo.com \
    --to=ashok_kumar_ak@yahoo.com \
    --cc=gcc@gcc.gnu.org \
    --cc=wilson@specifixinc.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).