From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8770C71153 for ; Sat, 2 Sep 2023 12:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352153AbjIBMg6 (ORCPT ); Sat, 2 Sep 2023 08:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232331AbjIBMg6 (ORCPT ); Sat, 2 Sep 2023 08:36:58 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 456AB10E4 for ; Sat, 2 Sep 2023 05:36:55 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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