From patchwork Mon Sep 9 09:40:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 19816 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 69A8024687 for ; Mon, 9 Sep 2013 09:40:19 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q5sf6562402yen.4 for ; Mon, 09 Sep 2013 02:40:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=5QHYfH6ZZdqwkLrZRK+bPLP57qxXScGJoMJ1dagrUEA=; b=Se750ToNIR8myXUp4vgtjLVseDW966Pb5Vft1PwPZj+hxaE1RoctMLBcHAhD/gXzLE fNmyfOcPlu8RQRV/xXU5alQLUkJ0fiXx2BHUsP07vkLvmPdjJvEIxNUStR5hyX6yDY45 3rnt3z/dqpqpL6qKOvp8ZFJTbiw5YPmIuJYZVzDzgMsMA9qJjYAnB8/oDo6d5P2svQ8y 0O83Ok7DBLCtmgKHS7/9+IKb0yJ8tXCc+SZL8Hwsi5jFprnzRVO1QgaojCJifj3rY5Ci KGcNRlbhnfIm4U1uzgUnpwW7N6J75tklnJElSUEPUMTRLTVcSU6mXW72AtpRFBbENljS l9xQ== X-Received: by 10.224.131.4 with SMTP id v4mr263821qas.1.1378719619229; Mon, 09 Sep 2013 02:40:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.11.179 with SMTP id r19ls1617378qeb.76.gmail; Mon, 09 Sep 2013 02:40:19 -0700 (PDT) X-Received: by 10.58.235.69 with SMTP id uk5mr16784973vec.17.1378719619147; Mon, 09 Sep 2013 02:40:19 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id zw10si2945683vdb.31.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 02:40:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id gd11so3672009vcb.19 for ; Mon, 09 Sep 2013 02:40:19 -0700 (PDT) X-Gm-Message-State: ALoCoQk961o1l3GgylzGR5RKJJ8VaDl5gBjiL8CeRNHPA4dRkvBxynDkHDJ9Ex3gfZPuNfmbqxMb X-Received: by 10.220.164.70 with SMTP id d6mr2179652vcy.19.1378719619060; Mon, 09 Sep 2013 02:40:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp77810vcz; Mon, 9 Sep 2013 02:40:18 -0700 (PDT) X-Received: by 10.205.76.133 with SMTP id ze5mr656072bkb.37.1378719617891; Mon, 09 Sep 2013 02:40:17 -0700 (PDT) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by mx.google.com with ESMTPS id tx8si1066250bkb.142.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 02:40:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.52 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.214.52; Received: by mail-bk0-f52.google.com with SMTP id e11so2202448bkh.11 for ; Mon, 09 Sep 2013 02:40:17 -0700 (PDT) X-Received: by 10.204.66.133 with SMTP id n5mr183586bki.38.1378719617217; Mon, 09 Sep 2013 02:40:17 -0700 (PDT) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginmedia.com. [82.1.113.198]) by mx.google.com with ESMTPSA id pk7sm2396329bkb.2.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 02:40:16 -0700 (PDT) Message-ID: <522D977E.2000906@linaro.org> Date: Mon, 09 Sep 2013 10:40:14 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: libc-ports@sourceware.org CC: patches@linaro.org Subject: [PATCH v3] ARM: Improve armv7 memcpy performance. X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Only enter the aligned copy loop with buffers that can be 8-byte aligned. This improves performance slightly on Cortex-A9 and Cortex-A15 cores for large copies with buffers that are 4-byte aligned but not 8-byte aligned. ports/ChangeLog.arm: 2013-08-30 Will Newton * sysdeps/arm/armv7/multiarch/memcpy_impl.S: Tighten check on entry to aligned copy loop to improve performance. --- ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Changes in v3: - Fixed comments diff --git a/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S b/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S index 3decad6..330bb2d 100644 --- a/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S +++ b/ports/sysdeps/arm/armv7/multiarch/memcpy_impl.S @@ -369,8 +369,8 @@ ENTRY(memcpy) cfi_adjust_cfa_offset (FRAME_SIZE) cfi_rel_offset (tmp2, 0) cfi_remember_state - and tmp2, src, #3 - and tmp1, dst, #3 + and tmp2, src, #7 + and tmp1, dst, #7 cmp tmp1, tmp2 bne .Lcpy_notaligned @@ -381,9 +381,9 @@ ENTRY(memcpy) vmov.f32 s0, s0 #endif - /* SRC and DST have the same mutual 32-bit alignment, but we may + /* SRC and DST have the same mutual 64-bit alignment, but we may still need to pre-copy some bytes to get to natural alignment. - We bring DST into full 64-bit alignment. */ + We bring SRC and DST into full 64-bit alignment. */ lsls tmp2, dst, #29 beq 1f rsbs tmp2, tmp2, #0