From patchwork Wed Jan 11 20:45:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 641261 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3457865pvb; Wed, 11 Jan 2023 12:46:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXtM+1g/C+XnQx2nyz/4Sf+4CcyQ+ZIG6tBysHFFOpfod43LAsXxZOsH8Un3wba9+VfKspq1 X-Received: by 2002:a17:907:c019:b0:7c0:b569:8efe with SMTP id ss25-20020a170907c01900b007c0b5698efemr59210091ejc.60.1673469980370; Wed, 11 Jan 2023 12:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673469980; cv=none; d=google.com; s=arc-20160816; b=dqSd1vMj8/LQK014XZrtkO4QZILIEG2SjoShORBDJ3WjPoKMTFyMPOfCLQ6K+/aTrj lfHL1OKuBKqPPxoGPkmWYHvqobdhxo64v5WN31Ekf5kHL7mng22WqYPOSMdko4Tbv8Nj pSEJjmi99Qr4EbYgj9/V870RzNnAr/TyL6gIv/IaSZhoj3Hn5EOM29gCHkF5uwfLhpUp T/JDxzvol2zQssxHCE8X0BquP0NdeQudqvsiWBxXG+G+qwhsGcwXFyk6SgwE9gxv82/R r9n5guTITCZ7nqJ+vcG1tugujMABQ19wNQlAqKsO7py+XGUHzPHY8c2YfJkbTB8sYmtK rUzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=p/ljwBtuCARrOKmgc9T6GFTlEl0KQ/8ti25LQF6aFf4=; b=XxEVx4pZqH52QwXeXq6w9V+iq/ridLr7Jn0YSBuG61Wwx09YoGh1vSp+s3Aj3cPebo lvfcFxzHWIrbI3cdA7IRcTRYIGlhkzpbuyiYdcS8Q1qTcz7zRSuXfDBxhxfbG97MSXmH ofYdntl12YcY1sBZnbzu0lRRpOUVryIq781cCGAwscftiOPrTQ5K14340UkPIElSD0nh 75EJTX5aN+gdw1csolIW7Zg9+7V1Ynfvwic2OPsRGHGOwAOIWCCnt/YoufjVqyZ/o9QJ 1stXRdroBfwdWKlG3z9CJY9ZP5friTdNGiudqAKvPtaiinYhOIV7P5QBBxWsqFo9kZT/ SkOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=eVlQjdCU; spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Return-Path: Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id du1-20020a17090772c100b0080f0493b9c8si17427599ejc.536.2023.01.11.12.46.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 12:46:20 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=eVlQjdCU; spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3A1D7385B538 for ; Wed, 11 Jan 2023 20:46:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A1D7385B538 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673469979; bh=p/ljwBtuCARrOKmgc9T6GFTlEl0KQ/8ti25LQF6aFf4=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=eVlQjdCU7JdlkArXe6UTDhinRdIeVL2VLUloMN433beieylS+j9viAGKHNYbUfQWg yxeFAKcwQU5PEmUcu6iUJJRO5lJsZEqy5ty5unFIp0UZk9lGbbAuzKXevRs7yLV+P0 K/JFaGNDGro7psTtrgCr/yJu0N/RN8a5VZprDlLs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 860193858C66 for ; Wed, 11 Jan 2023 20:46:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 860193858C66 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-150b06cb1aeso16806001fac.11 for ; Wed, 11 Jan 2023 12:46:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p/ljwBtuCARrOKmgc9T6GFTlEl0KQ/8ti25LQF6aFf4=; b=SMUAT1lxBgcsD9vhyQOEAKwBnpAt/iao019m3wUxNkShKOVedjrh+RsGpYKbzMVRxT PbPhs0nZ2F3h9hZkDQYuephGChuVkx3VhgQ0HZI/kdS6YOtfnPU2hcG7oX1cijLJ0pQG iUzSEXmYmqqWi/WltcXhY4ehDqjo4IJM0FRQzI0JIQhxykHuIyGjgQmC+Ifk2bDd2yNE c51P7NP9BcSvQVo2Q6BJC+qeB+XU60dWEvU7a/59H7S0HV0TuC4QCo0tsafwn4n801B6 eecwUm3Dyt4LmLFRqZU8vz8wnYlHNNV0AULxJLpYeYIOQdLXTlfuhnCa+DcWLfqtywHL sXmg== X-Gm-Message-State: AFqh2kqjV0xrucq0z2oN8kHw7sDtaOrgtbjiA5zuFcvG8u44d5gwv3ST tf+FdbAPrXNCjR+ecXqpxGNxC97jXDycW1trGNU= X-Received: by 2002:a05:6870:7805:b0:13b:6696:578a with SMTP id hb5-20020a056870780500b0013b6696578amr40929316oab.53.1673469966136; Wed, 11 Jan 2023 12:46:06 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c0:a93a:a504:f3f6:dd7b:801]) by smtp.gmail.com with ESMTPSA id kw18-20020a056870ac1200b0014c8b5d54b2sm7990274oab.20.2023.01.11.12.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 12:46:05 -0800 (PST) To: libc-alpha@sourceware.org, Noah Goldstein , Richard Henderson Cc: Adhemerval Zanella Netto Subject: [PATCH v7 01/17] Parameterize op_t from memcopy.h Date: Wed, 11 Jan 2023 17:45:42 -0300 Message-Id: <20230111204558.2402155-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230111204558.2402155-1-adhemerval.zanella@linaro.org> References: <20230111204558.2402155-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+patch=linaro.org@sourceware.org Sender: "Libc-alpha" From: Adhemerval Zanella Netto It moves the op_t definition out to an specific header, adds the attribute 'may-alias', and cleanup its duplicated definitions. Checked with a build and check with run-built-tests=no for all major Linux ABIs. --- string/memcmp.c | 1 - sysdeps/generic/memcopy.h | 6 ++---- sysdeps/generic/string-optype.h | 24 ++++++++++++++++++++++++ sysdeps/x86_64/x32/string-optype.h | 24 ++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 sysdeps/generic/string-optype.h create mode 100644 sysdeps/x86_64/x32/string-optype.h diff --git a/string/memcmp.c b/string/memcmp.c index 067b2e6a42..ea0fa03e1c 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -46,7 +46,6 @@ /* Type to use for aligned memory operations. This should normally be the biggest type supported by a single load and store. Must be an unsigned type. */ -# define op_t unsigned long int # define OPSIZ (sizeof (op_t)) /* Threshold value for when to enter the unrolled loops. */ diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h index 9f3ffb5d30..b5ffa4d114 100644 --- a/sysdeps/generic/memcopy.h +++ b/sysdeps/generic/memcopy.h @@ -55,10 +55,8 @@ [I fail to understand. I feel stupid. --roland] */ -/* Type to use for aligned memory operations. - This should normally be the biggest type supported by a single load - and store. */ -#define op_t unsigned long int +/* Type to use for aligned memory operations. */ +#include #define OPSIZ (sizeof (op_t)) /* Type to use for unaligned operations. */ diff --git a/sysdeps/generic/string-optype.h b/sysdeps/generic/string-optype.h new file mode 100644 index 0000000000..42bdd2a145 --- /dev/null +++ b/sysdeps/generic/string-optype.h @@ -0,0 +1,24 @@ +/* Define a type to use for word access. Generic version. + Copyright (C) 2023 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 + . */ + +#ifndef _STRING_OPTYPE_H +#define _STRING_OPTYPE_H 1 + +typedef unsigned long int __attribute__ ((__may_alias__)) op_t; + +#endif /* string-optype.h */ diff --git a/sysdeps/x86_64/x32/string-optype.h b/sysdeps/x86_64/x32/string-optype.h new file mode 100644 index 0000000000..e7679f934f --- /dev/null +++ b/sysdeps/x86_64/x32/string-optype.h @@ -0,0 +1,24 @@ +/* Define a type to use for word access. Generic version. + Copyright (C) 2023 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 + . */ + +#ifndef _STRING_OPTYPE_H +#define _STRING_OPTYPE_H 1 + +typedef unsigned long long int __attribute__ ((__may_alias__)) op_t; + +#endif /* string-optype.h */