From patchwork Fri Jan 13 18:27:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 642036 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp357751pvb; Fri, 13 Jan 2023 10:27:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXvGZsF9kl/q21MKAqW8VUInG2xib3448avbvv19GCPOdpTLO+oVsi0RNirrjunvLvVlsssW X-Received: by 2002:a50:eac6:0:b0:461:d042:80db with SMTP id u6-20020a50eac6000000b00461d04280dbmr71128199edp.0.1673634469731; Fri, 13 Jan 2023 10:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673634469; cv=none; d=google.com; s=arc-20160816; b=yoCHA5fbEdZ0oKUD5HNfLBqz/crFFRTj29vrIcXG+idKvJvQ0+SyTirTvUH2MRul0b Lpm9ozlKTlAb3Ft4Yi6KbZrqlIQGCf6atvwg6EVNGgf8Gh05lXcqoJti7g4DldBDr3TH GTk6V0Rn02T5W2wCEkhPwG4NpAaTgNXTdRJHFotIGFwf+QGINcQj2DddJIMdfNk3CV6q waomFSgFXw96xm3IcqnHOX/m35I18H2Usqc+9W/Ht2zZLGp7vV8zEzN3SzUzzsbspIRV mosgYO3f/eFxfPQCvRxT4YLVeORpNtsNAjNEG1wBzLlEpUAeqIcG3p0goux6zPt80LlU R7ig== 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=s7htVBDI/GEyKJawwkD95640SDCHWN/0Ibq4jZ18+QM=; b=H4GVcwTT2VC0QSdubNhdyQhb5XA+9+4LbzgS0Kn1kBj3X2wS3e3jBcLcdnIaAKgkNO jLynDIvXxrL2OIEDqSNf79SQiQ2roC0OGa1XFk/mpcHlVOmyJRqypXNxDYul3PjzbjDW e0ZRSV9S6yKD+YDCcjUnXjyFmj5p46065qfSm7dLCRmNOUNuRmN3+gsD1sDyPgIxWimU ETtO1fJxrw4HPDj4vxMTPfnOulch+tF7FE/N0E8qQCCPFFx1gePXd9Op6Q4nDWKB1g7U 9E+nu8FAVL6h59O6yHKW8vCgHvoZtUO70qGxGlkXjYJp0GEdigtQqRIqivOg+uyG+xSd LxQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="UUa/D28n"; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hr15-20020a1709073f8f00b008699e402620si3948933ejc.518.2023.01.13.10.27.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 10:27:49 -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="UUa/D28n"; 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 850C038493E0 for ; Fri, 13 Jan 2023 18:27:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 850C038493E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673634468; bh=s7htVBDI/GEyKJawwkD95640SDCHWN/0Ibq4jZ18+QM=; 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=UUa/D28nwFH1CfM1qxb5+UH3EPwfmlO5eK0hj2qZZ0cs4pKbsSouaZmYw+heBSvAj Br4t6Tl1YLz28uBluobQ1D7krTIhSlkbvXnHAaC+YRT3zMMVLj0bCflcYpvBe3HgQi diKnF19Pspvq+wBygYKamd+oaukq7aqW3wV6cqok= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id CF2C73858004 for ; Fri, 13 Jan 2023 18:27:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF2C73858004 Received: by mail-pl1-x635.google.com with SMTP id jl4so24252469plb.8 for ; Fri, 13 Jan 2023 10:27:38 -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=s7htVBDI/GEyKJawwkD95640SDCHWN/0Ibq4jZ18+QM=; b=1TmPwS94oAa9oL9d6bBsZH3mbK5mXNyXjr+jYZhL+i4DR5tGsljQRzGYjmkwtlqONt 3wqJV+omzFfA14jIiBDz9/X9Oh7N8ociADz7pH8feayUHRMTENKfF8FZoXU+TFABuizo cifT2Dv3crY5YZb6lcUYgdCUztl/qg/hh+fbImzm2j2zvih7z180w1K33cBLJ7jjz4Hf VrZlp2nVhmUIX1j7cVUCT6HhLe/ts3y8F3wUiGWGRKU3vaePxR1Nlpxrt6m1FpmVM9CK GG/d2bXvDyfitTHnFF7zUVYjbRaiDcr8rp9x74abs4k9+txEaouAK0u4CLBPohPxOjwN ENWg== X-Gm-Message-State: AFqh2kqF7dZ4ONVnvWkjNu/EGOPs4BYriwexWM8Q4XMye74r6nsb0aYg XgYSrXUiML3sxKq4+JDU2CBitnKhvj2OTwy8 X-Received: by 2002:a17:903:1355:b0:193:3a92:f4bd with SMTP id jl21-20020a170903135500b001933a92f4bdmr12201555plb.47.1673634457933; Fri, 13 Jan 2023 10:27:37 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id s17-20020a170902c65100b001927ebc40e2sm14443640pls.193.2023.01.13.10.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 10:27:37 -0800 (PST) To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, goldstein.w.n@gmail.com Subject: [PATCH v8 01/17] Parameterize op_t from memcopy.h Date: Fri, 13 Jan 2023 08:27:17 -1000 Message-Id: <20230113182733.1268668-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113182733.1268668-1-richard.henderson@linaro.org> References: <20230113182733.1268668-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 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: Richard Henderson via Libc-alpha From: Richard Henderson Reply-To: Richard Henderson 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. Message-Id: <20230111204558.2402155-2-adhemerval.zanella@linaro.org> Reviewed-by: Richard Henderson --- sysdeps/generic/memcopy.h | 6 ++---- sysdeps/generic/string-optype.h | 24 ++++++++++++++++++++++++ sysdeps/x86_64/x32/string-optype.h | 24 ++++++++++++++++++++++++ string/memcmp.c | 1 - 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/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 */ 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. */