All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>
Cc: "R. J. Wysocki" <rjwysocki@sisk.pl>, Andi Kleen <ak@suse.de>,
	linux-kernel@vger.kernel.org, discuss@x86-64.org
Subject: Re: Opteron bug
Date: Mon, 21 Jun 2004 01:29:21 -0400	[thread overview]
Message-ID: <20040621052921.GC21264@devserv.devel.redhat.com> (raw)
In-Reply-To: <200406210254.53124.vda@port.imtp.ilyichevsk.odessa.ua>

On Mon, Jun 21, 2004 at 02:54:53AM +0300, Denis Vlasenko wrote:
> On Sunday 20 June 2004 15:02, Jakub Jelinek wrote:
> > On Sun, Jun 20, 2004 at 01:47:17PM +0200, R. J. Wysocki wrote:
> > > Well, is there any case in which the gcc can produce such stuff?
> >
> > GCC doesn't ever generate std instruction (only cld), though users
> > can use it in inline assembly or assembly source file.
> > AFAIK x86_64 glibc doesn't use it at all either.
> 
> glibc-2.3/sysdeps/i386/memcopy.h:
> 
> #define BYTE_COPY_BWD(dst_ep, src_ep, nbytes)                                 \
>   do                                                                          \
>     {                                                                         \
>       int __d0;                                                               \
>       asm volatile(/* Set the direction flag, so copying goes backwards.  */  \
>                    "std\n"                                                    \
>                    /* Copy bytes.  */                                         \
>                    "rep\n"                                                    \
>                    "movsb\n"                                                  \
>                    /* Clear the dir flag.  Convention says it should be 0. */ \
>                    "cld" :                                                    \
>                    "=D" (dst_ep), "=S" (src_ep), "=c" (__d0) :                \
>                    "0" (dst_ep - 1), "1" (src_ep - 1), "2" (nbytes) :         \
>                    "memory");                                                 \
>       dst_ep += 1;                                                            \
>       src_ep += 1;                                                            \
>     } while (0)
> 
> WORD_COPY_BWD also does this

I know, but I said x86_64 glibc, which doesn't do this.

	Jakub

  parent reply	other threads:[~2004-06-21  5:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-19 20:29 Opteron bug R. J. Wysocki
2004-06-20 13:22 ` Andi Kleen
2004-06-20 11:47   ` R. J. Wysocki
2004-06-20 12:02     ` Jakub Jelinek
     [not found]       ` <200406210254.53124.vda@port.imtp.ilyichevsk.odessa.ua>
2004-06-21  5:29         ` Jakub Jelinek [this message]
2004-06-20 13:49     ` Andi Kleen
2004-07-12 17:34   ` [discuss] " H. Peter Anvin
2004-07-12 18:57     ` Richard B. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2004-06-20 13:07 Manfred Spraul
2004-06-20 21:49 ` Andi Kleen

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=20040621052921.GC21264@devserv.devel.redhat.com \
    --to=jakub@redhat.com \
    --cc=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjwysocki@sisk.pl \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /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.