From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 8C0D43858D35 for ; Wed, 1 Feb 2023 17:04:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C0D43858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x330.google.com with SMTP id 14-20020a9d010e000000b0068bdddfa263so2005306otu.2 for ; Wed, 01 Feb 2023 09:04:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AjKGR2n03+tuVqqBGNtzj55eB24LbWfBk9DVbP0bD/k=; b=bFpnzaH+bs1WBX4+QZ13twAGeZB3CGbWYW4wMDTII/irHWAdxuZHTD9gg/RdeFPjPS pe+iSFK68OBIQN+yFeGQ9KYNUSG1dZXsJpHU87uf+1L6nJHEt+hW7Z2jq2HoFJnzBeop xy6FOZEX5SIKx5D3ewt5r9dsfNjnLGNQETvScUDLWDJeJVnFviRcAMgDRfTgJ0j14XTb W7CSz+U7ywyu01amBqlorIxotIQnW4gCc7ylG0sDkz8+uC1YCX7Sj4L3Mg/SZdlYWMrA vu6v6alUHIjmFNe/1WlIqyvZ/oo5kDEjS83iK4bSN2fDi4YRWsdI0UI//3MxKOaV0Hpz fsJg== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AjKGR2n03+tuVqqBGNtzj55eB24LbWfBk9DVbP0bD/k=; b=XzzJeFVIWLZDk85YaaA0fLVeI7cT+p9+jSujATOSOQooolp/zRA0LYkDj/snnsu96S iHWCEfMJSKddBzFygJktg4LYGNi4dXKwaHWJ+DeeNzeJTWED5JUoh+TS/8xwYJcc3g8Y zsOiLPKI7sq770gLVfYDjN+qYyc4s9x5ORCdtUt55WwsVYxpQxMO1BU8siKcYQwJnKuD RJSjgLJ5E2pV+FdS3JgG6gAD45iA63js7J2FxCDwruDxspeoUaovBYEhSFf4IRWSWtGt 3LaqUwNiJItfQdjaFGdpnhSxJK86x5VPmeMrwQLLLPNOS+7mfnT0l9MkzU/R14DFQeDl 0Qlg== X-Gm-Message-State: AO0yUKX0J8/Nr3i0jBTLI6B+f0bnOgVZjSOXw/WGZE3VRAHbecS6y2We nKdRIyz7E96eTurRh/uQkRg9dtlHo5vKiODQwxs= X-Google-Smtp-Source: AK7set/BvhTC0queHzG6xyeU4yXbcX7Z7tGEQlty7PxFk7g44MZPVe1O0h2R+fPJdjiQxEeTonFL5w== X-Received: by 2002:a05:6830:348a:b0:68c:34ae:be12 with SMTP id c10-20020a056830348a00b0068c34aebe12mr2194414otu.25.1675271055918; Wed, 01 Feb 2023 09:04:15 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:1887:d2ed:98c2:d2cc:bf06]) by smtp.gmail.com with ESMTPSA id b17-20020a056830311100b006863ccbf067sm8077090ots.74.2023.02.01.09.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 09:04:15 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org, Richard Henderson , Noah Goldstein , Jeff Law , Xi Ruoyao Subject: [PATCH v11 01/29] Parameterize op_t from memcopy.h Date: Wed, 1 Feb 2023 14:03:38 -0300 Message-Id: <20230201170406.303978-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201170406.303978-1-adhemerval.zanella@linaro.org> References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. Reviewed-by: Richard Henderson --- 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 */ -- 2.34.1