From patchwork Thu Feb 10 19:58:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 51024 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0B8A3858427 for ; Thu, 10 Feb 2022 20:02:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0B8A3858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644523357; bh=lv+6JbiqPBvWIFaxHaXaIr7Dpnzch6MlsausK7JqMtQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GMsV3Q9Iz0DO1IKXR2RFG6pdbS3rdkXUt6gH8LK9aFyZfLY0ppIkDNUF3VPtVrU9v XDksYnZrc4tRXezGmjqpN5+NVIyA9km+bsrYnPpnm2rsx4fCxiHu1XIkJfTxye11IC t7OGzcsx3pxAYH3LXSw/UQgM7d+0wF3lXAvBH3QA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by sourceware.org (Postfix) with ESMTPS id D834D3858429 for ; Thu, 10 Feb 2022 19:58:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D834D3858429 Received: by mail-oo1-xc29.google.com with SMTP id f11-20020a4abb0b000000b002e9abf6bcbcso7760308oop.0 for ; Thu, 10 Feb 2022 11:58:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lv+6JbiqPBvWIFaxHaXaIr7Dpnzch6MlsausK7JqMtQ=; b=eHxO3kcm9EdqXVgIxDZiX3EQBS1uWQfAAr2Segv9RVF3mm8TCBN2hC0ctmYE3sdKFJ WDXbL6cFA1nfDAbJmL1uL0B6y7XqOJKHfzhhoxY6UrohETt1mTtvVdSTFUi5K1nVvk6b jNhcxC8+b69cwFXi+351SBuH1UKg51xQGDclJFtmAEmnpDIblYBFbnR9ClXjMaekg8WJ LvB8G475vk+DsTp755awh06qpRvdVddTaQ/fIstRZqDiknnENhDFMC5zD/N+JknJ+9pW t8ueWv+1YYUBtcTu2LPPAvDgypVPNrbjKBd7+JBCMIaUsA2cLi/ulBVr8Eo03Azk8vGl /K+w== X-Gm-Message-State: AOAM530fQM7e66+T1YwZJoRPTOyYAPPXb2po/HkbxBjj2lVnqlWewmxx xHb3koxlqkM8sWmkrNPu/64sw5gWEYP7PA== X-Google-Smtp-Source: ABdhPJyABeBYPRKH2uFvasxsui7m2d2T44RtXK2bihZn1/oqAObI/TFGF18Q1+/ziF3lBozrxoKJEw== X-Received: by 2002:a05:6870:d411:: with SMTP id i17mr1329938oag.272.1644523130120; Thu, 10 Feb 2022 11:58:50 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:a925:765e:3799:3d34]) by smtp.gmail.com with ESMTPSA id bg34sm8859219oob.14.2022.02.10.11.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 11:58:49 -0800 (PST) To: libc-alpha@sourceware.org, Wilco Dijkstra , "H . J . Lu" , Noah Goldstein Subject: [PATCH 05/12] alpha: Remove bzero optimization Date: Thu, 10 Feb 2022 16:58:31 -0300 Message-Id: <20220210195838.1036012-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> References: <20220210195838.1036012-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The symbols is not present in current POSIX specification and compiler already generates memmove call. --- sysdeps/alpha/bzero.S | 109 ------------------------------------------ 1 file changed, 109 deletions(-) delete mode 100644 sysdeps/alpha/bzero.S diff --git a/sysdeps/alpha/bzero.S b/sysdeps/alpha/bzero.S deleted file mode 100644 index 4821778622..0000000000 --- a/sysdeps/alpha/bzero.S +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 1996-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* Fill a block of memory with zeros. Optimized for the Alpha architecture: - - - memory accessed as aligned quadwords only - - destination memory not read unless needed for good cache behaviour - - basic blocks arranged to optimize branch prediction for full-quadword - aligned memory blocks. - - partial head and tail quadwords constructed with byte-mask instructions - - This is generally scheduled for the EV5 (got to look out for my own - interests :-), but with EV4 needs in mind. There *should* be no more - stalls for the EV4 than there are for the EV5. -*/ - - -#include - - .set noat - .set noreorder - - .text - .type __bzero, @function - .globl __bzero - .usepv __bzero, USEPV_PROF - - cfi_startproc - - /* On entry to this basic block: - t3 == loop counter - t4 == bytes in partial final word - a0 == possibly misaligned destination pointer */ - - .align 3 -bzero_loop: - beq t3, $tail # - blbc t3, 0f # skip single store if count even - - stq_u zero, 0(a0) # e0 : store one word - subq t3, 1, t3 # .. e1 : - addq a0, 8, a0 # e0 : - beq t3, $tail # .. e1 : - -0: stq_u zero, 0(a0) # e0 : store two words - subq t3, 2, t3 # .. e1 : - stq_u zero, 8(a0) # e0 : - addq a0, 16, a0 # .. e1 : - bne t3, 0b # e1 : - -$tail: bne t4, 1f # is there a tail to do? - ret # no - -1: ldq_u t0, 0(a0) # yes, load original data - mskqh t0, t4, t0 # - stq_u t0, 0(a0) # - ret # - -__bzero: -#ifdef PROF - ldgp gp, 0(pv) - lda AT, _mcount - jsr AT, (AT), _mcount -#endif - - mov a0, v0 # e0 : move return value in place - beq a1, $done # .. e1 : early exit for zero-length store - and a0, 7, t1 # e0 : - addq a1, t1, a1 # e1 : add dest misalignment to count - srl a1, 3, t3 # e0 : loop = count >> 3 - and a1, 7, t4 # .. e1 : find number of bytes in tail - unop # : - beq t1, bzero_loop # e1 : aligned head, jump right in - - ldq_u t0, 0(a0) # e0 : load original data to mask into - cmpult a1, 8, t2 # .. e1 : is this a sub-word set? - bne t2, $oneq # e1 : - - mskql t0, a0, t0 # e0 : we span words. finish this partial - subq t3, 1, t3 # e0 : - addq a0, 8, a0 # .. e1 : - stq_u t0, -8(a0) # e0 : - br bzero_loop # .. e1 : - - .align 3 -$oneq: - mskql t0, a0, t2 # e0 : - mskqh t0, a1, t3 # e0 : - or t2, t3, t0 # e1 : - stq_u t0, 0(a0) # e0 : - -$done: ret - - cfi_endproc -weak_alias (__bzero, bzero)