From: Ammar Faizi <[email protected]>
To: Alviro Iskandar Setiawan <[email protected]>
Cc: "Willy Tarreau" <[email protected]>,
"Thomas Weißschuh" <[email protected]>,
"David Laight" <[email protected]>,
"Nicholas Rosenberg" <[email protected]>,
"Michael William Jonathan" <[email protected]>,
"GNU/Weeb Mailing List" <[email protected]>,
"Linux Kernel Mailing List" <[email protected]>
Subject: Re: [RFC PATCH v2 1/4] tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()`
Date: Sat, 2 Sep 2023 19:36:47 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAOG64qOuAfHREhcsC3THmhvH+NjhZRJtxp8gG39NosdhbZQvLA@mail.gmail.com>
On 2023/09/02 午後7:29, Alviro Iskandar Setiawan wrote:
> On Sat, Sep 2, 2023 at 1:38 PM Ammar Faizi wrote:
>> Ok, I'll do that.
>
> Another micro-optimization. Since the likely case is the forward copy,
> make it the case that doesn't take the jump.
>
> Pseudo C:
> if (unlikely(dst - src < n))
> backward_copy();
> else
> forward_copy();
Point taken.
--
Ammar Faizi
next prev parent reply other threads:[~2023-09-02 12:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-02 5:50 [RFC PATCH v2 0/4] nolibc x86-64 string functions Ammar Faizi
2023-09-02 5:50 ` [RFC PATCH v2 1/4] tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()` Ammar Faizi
2023-09-02 6:07 ` Alviro Iskandar Setiawan
2023-09-02 6:11 ` Ammar Faizi
2023-09-02 6:22 ` Willy Tarreau
2023-09-02 6:37 ` Ammar Faizi
2023-09-02 12:29 ` Alviro Iskandar Setiawan
2023-09-02 12:36 ` Ammar Faizi [this message]
2023-09-03 20:35 ` David Laight
2023-09-02 5:50 ` [RFC PATCH v2 2/4] tools/nolibc: x86-64: Use `rep stosb` for `memset()` Ammar Faizi
2023-09-02 5:50 ` [RFC PATCH v2 3/4] tools/nolibc: string: Remove the `_nolibc_memcpy_down()` function Ammar Faizi
2023-09-02 5:50 ` [RFC PATCH v2 4/4] tools/nolibc: string: Remove the `_nolibc_memcpy_up()` function Ammar Faizi
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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