public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Subject: Re: V2 [PATCH] x86-64: Avoid rep movsb with short distance [BZ #27130]
Date: Mon, 4 Jan 2021 07:27:16 -0800	[thread overview]
Message-ID: <CAMe9rOqENAGBdV6Kuz+4dW5aoR3CR38-qyqiN76jcWhETUt8Cw@mail.gmail.com> (raw)
In-Reply-To: <874kjwloah.fsf@oldenburg2.str.redhat.com>

On Mon, Jan 4, 2021 at 7:22 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> >  1:
> > +# if AVOID_SHORT_DISTANCE_REP_MOVSB
> > +     movq    %rsi, %rcx
> > +     subq    %rdi, %rcx
> > +2:
> > +/* Avoid "rep movsb" if RCX, the distance between source and destination,
> > +   is N*4GB + [1..63] with N >= 0.  */
> > +     cmpl    $63, %ecx
> > +     jbe     L(more_2x_vec)  /* Avoid "rep movsb" if ECX <= 63.  */
> > +# endif
> >       mov     %RDX_LP, %RCX_LP
> >       rep movsb
> >  L(nop):
>
> Why not use _LP names here?  I think the %ecx comparison at least can
> give false results on x86-64 (64-bit).
>

This is done on purpose since we want to avoid "rep movsb" for distances of
N*4GB + [1..63] with N >= 0 which include 0x100000003.

-- 
H.J.

  reply	other threads:[~2021-01-04 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 15:17 H.J. Lu
2021-01-04 15:22 ` Florian Weimer
2021-01-04 15:27   ` H.J. Lu [this message]
2021-01-04 15:47     ` Florian Weimer
2021-01-04 15:54       ` H.J. Lu

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=CAMe9rOqENAGBdV6Kuz+4dW5aoR3CR38-qyqiN76jcWhETUt8Cw@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).