public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Paubert <paubert@iram.es>
To: Mark Zealey <mark@zealos.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Assembly question
Date: Fri, 26 Apr 2002 13:37:46 +0200	[thread overview]
Message-ID: <3CC93C0A.1030500@iram.es> (raw)
In-Reply-To: <20020425083225.GA30247@webvilag.com> <20020425235240.GA28851@itsolve.co.uk>

Mark Zealey wrote:

 > On Thu, Apr 25, 2002 at 10:32:25AM +0200, Szekeres Istvan wrote:
 >
 >
 >> void p_memset_dword( void *d, int b, int l ) { __asm__ ("rep\n\t" 
"stosl\n\t"
 >>

 >> : : "D" (d), "a" (b), "c" (l) : "memory","edi", "eax", "ecx"
 >>
 >
 > An input or output operand is implicitly clobbered, so it should be
      ^^^^^
I had expected gcc specialists to jump on that one: if you don't
explicitly tell gcc that an input is clobbered, it may reuse it later if
it needs the same value. So the clobbers are necessary...

Your statement about output operands is also incorrect, since clobbered
means that the register has an unknown value, which can not be used for
_anything_, while outputs are results from the statement and they'll
likely be used later (if none of the outputs is ever used and the asm 
statement is not marked volatile, gcc will not even bother to emit it).

	Regards,
	Gabriel.


  reply	other threads:[~2002-04-26 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-25  8:32 Assembly question Szekeres Istvan
2002-04-25 23:52 ` Mark Zealey
2002-04-26 11:37   ` Gabriel Paubert [this message]
2002-04-26 12:34     ` Richard B. Johnson
2002-04-28 18:07       ` Zack Weinberg

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=3CC93C0A.1030500@iram.es \
    --to=paubert@iram.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@zealos.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox