From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,URIBL_BLOCKED, URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1693658214; bh=NNpqYT9YeF3YXjLBcd5b0oMc+DCin9FvQPyvtuAfieY=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=tC8RJvvSbIOd9SJKKD/jaqhMGzVZphMQ1hV0SYvUz/Fv0Gw68sbTtb/HddVovfrx+ TTMC9Oa8MMjii9AfuPeTBPV2pL3lrrIgdSqJDUAcVHuj/1zN8xYeWGlmQ5ypOug5pW lLZl7WwUgH9IyYFkeUMkAyi0XzkapdSgYr/eI8AulwyZk0y8po5uaON1PZRshKQh75 zep7yOlPe6AE7zinUSe98YHE0+G0XvxwZq3QmBNM/wSxUJ5KCqxlM2JirwRbZi5g7E LHI2Nqg8xGEXRwBLKcZgM1AmvEfpTl1hWoEKocDMyxiOoGFGgWrXvMHFSdQF4/cAID PPnzg1pBy2xCA== Received: from [10.20.0.2] (unknown [182.253.126.208]) by gnuweeb.org (Postfix) with ESMTPSA id 766CB24B39E; Sat, 2 Sep 2023 19:36:51 +0700 (WIB) Message-ID: <4459ed19-f603-b4f6-392e-4e1322e06d56@gnuweeb.org> Date: Sat, 2 Sep 2023 19:36:47 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC PATCH v2 1/4] tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()` Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Willy Tarreau , =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= , David Laight , Nicholas Rosenberg , Michael William Jonathan , GNU/Weeb Mailing List , Linux Kernel Mailing List References: <20230902055045.2138405-1-ammarfaizi2@gnuweeb.org> <20230902055045.2138405-2-ammarfaizi2@gnuweeb.org> <20230902062237.GA23141@1wt.eu> From: Ammar Faizi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: 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