linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: nai.xia@gmail.com
Cc: Andi Kleen <ak@linux.intel.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux-MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Question about missing "cld" in x86 string assembly code
Date: Sat, 17 Dec 2011 12:08:36 -0500	[thread overview]
Message-ID: <CAMzpN2inHxaSnaYaYXZ4Ya3rK+MWXqR6dN5NVNZy3=OvP04uQA@mail.gmail.com> (raw)
In-Reply-To: <201112172258.24221.nai.xia@gmail.com>

On Sat, Dec 17, 2011 at 9:58 AM, Nai Xia <nai.xia@gmail.com> wrote:
> Hi Andi,
>
> Seems I used a stale email address of you from a related git commit log,
> so this is a resend, sorry.
>
> =======
> Hi,
>
> I notice that all x86 assembly code for string operations containing
> "scasb, lodsb", etc does not have "cld" at the beginning.
> Is this 100% safe?
> Or in other words, how could we be sure that
> there is no "std" generated by compiler somewhere just before
> the string operations?
>
>
> Thanks,
>
> Nai
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

The i386 ELF ABI states "The direction flag must be set to the
‘‘forward’’ (that is, zero) direction before entry and upon exit from
a function."  Therefore it can be assumed to be clear, unless
explicitly set.

--
Brian Gerst

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-12-17 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 14:58 Nai Xia
2011-12-17 17:08 ` Brian Gerst [this message]
2011-12-17 18:39   ` Linus Torvalds
2011-12-22 15:52     ` nai.xia
2011-12-22 15:34   ` nai.xia
  -- strict thread matches above, loose matches on Subject: below --
2011-12-17 14:52 Nai Xia

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='CAMzpN2inHxaSnaYaYXZ4Ya3rK+MWXqR6dN5NVNZy3=OvP04uQA@mail.gmail.com' \
    --to=brgerst@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nai.xia@gmail.com \
    --cc=torvalds@linux-foundation.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