From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 056B01F8C6 for ; Sat, 28 Aug 2021 02:58:03 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 82C3A3858003 for ; Sat, 28 Aug 2021 02:58:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82C3A3858003 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630119481; bh=2p5vnbGlW06YQv0vzY4miAb3Lx32SXR85RPBFKInInE=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=HTmrMEHS535PpLVc/se1Oxw45I8PHtlMFEo9oegKk9sCA1AbVHIirHqYMxlTmMC/B eBH2njxd4oBsWyNnOY4kk66ijbOqObk5wY+U9eZvmA86gRqcaSryEk72DMJ41z2hXs gHRYqWDHKwbBq60KWO0iJuyul5A6nchu5pqxhKyk= Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 2908D3858423 for ; Sat, 28 Aug 2021 02:57:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2908D3858423 Received: by mail-pj1-x1030.google.com with SMTP id u11-20020a17090adb4b00b00181668a56d6so6168115pjx.5 for ; Fri, 27 Aug 2021 19:57:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ok3y+MgG6M9HG0Vm0lagpFK1xU/CqVCnMi6Zzdx3oeA=; b=MZiOzZTFZ7yolWfdhEqPXLpe1koj1mREc1n65z27IVfJExZwvyIZV7uOp8sX/hwI6U CWgRom2Zr2X03rJuAc7ZJwuSmpMkdJ2aTJGDgZOA/cZ6BJ9mVR7fwmb7fYm8xlJ4fCmk zlZbyeL2zTnCJXC6ZHVBePueF3982xy+ZMIWF3iaeI5F4nFYoP1LmGWphXKn7Y5R1u5i 12Fj/16iMNC+JW7r78IpWexfLqxBmuSYz46NvMt+bCEkaHxdaXtjNmJUo+pnyr9KyreA r05w6DbPTiI6fxjxp40xP23qNad5+ynkN4yxVn6O+s9ew2TaA5K6RmojrhW05a+CP6yi kf8g== X-Gm-Message-State: AOAM531olNvbPk7cKnlESV32V3gyMsTUTXL6LIcEplZNYQTlllm2R+dY HKdf4XrE/TrKAQUxFmEDdYYI8lWYGrakuM65efg= X-Google-Smtp-Source: ABdhPJy+BCqX2RmHhznIBa4V6k9Va4AU8enuKiCcjb1YSEVCTN3My3CbGbhe6fz9vpjwLqQRRWLQnZmNUkIUuTAlBQo= X-Received: by 2002:a17:90a:8b95:: with SMTP id z21mr25779234pjn.131.1630119461321; Fri, 27 Aug 2021 19:57:41 -0700 (PDT) MIME-Version: 1.0 References: <20210726120055.1089971-1-hjl.tools@gmail.com> In-Reply-To: Date: Fri, 27 Aug 2021 22:57:30 -0400 Message-ID: Subject: Re: [PATCH] x86-64: Add Avoid_Short_Distance_REP_MOVSB To: Alexey Tourbin Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Noah Goldstein via Libc-alpha Reply-To: Noah Goldstein Cc: GNU C Library Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Fri, Aug 27, 2021 at 8:28 PM Alexey Tourbin via Libc-alpha < libc-alpha@sourceware.org> wrote: > On Mon, Jul 26, 2021 at 3:03 PM H.J. Lu via Libc-alpha > wrote: > > --- a/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S > > +++ b/sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S > > @@ -325,12 +325,16 @@ L(movsb): > > /* Avoid slow backward REP MOVSB. */ > > jb L(more_8x_vec_backward) > > # if AVOID_SHORT_DISTANCE_REP_MOVSB > > + andl $X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, > __x86_string_control(%rip) > > + jz 3f > > movq %rdi, %rcx > > subq %rsi, %rcx > > jmp 2f > > # endif > > 1: > > # if AVOID_SHORT_DISTANCE_REP_MOVSB > > + andl $X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB, > __x86_string_control(%rip) > > + jz 3f > > movq %rsi, %rcx > > subq %rdi, %rcx > > 2: > > Why "andl" rather than "testl"? > +1. I missed that before. My patches: [PATCH 5/5] X86-64: Optimize memmove-vec-unaligned-erms.S uses `testl` instead. Although my patch might not be checked in (and it may be a while) as we are still looking into the causes of the slowdown.