From patchwork Wed Jan 10 12:47:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 124084 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5235555qgn; Wed, 10 Jan 2018 04:49:56 -0800 (PST) X-Google-Smtp-Source: ACJfBouZgsSRyeAgnH/LLBl+wiTEPKWeeT4aFIrlETTiACDHwe0fgCZDJKkv1poljufbs8Vfm6J5 X-Received: by 10.101.75.81 with SMTP id k17mr14481869pgt.301.1515588596410; Wed, 10 Jan 2018 04:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515588596; cv=none; d=google.com; s=arc-20160816; b=K6tE9yKC8W1mByXW5vdMv267ZOBjTb3PO6V/HaMB+qQ5vuEXBjNzG+mP49PD9MujYB ATpGSHN/g3RaZsKdxL0c15xKdd1GSVa+EC+qrXHfIrB29m0hCh1vjtnbum99r8KllVBL x7eks90bk497sYVgw8e8kEg0KhLGLWVcuu76Hn79ijLcW7XrZAT3QmZo7Exd5+MsKwvO r0sLDn/2k5DvFFRapXqEkABH5OUexPQn71l6REJjIcGLC+7iJJNR1PvQ15Dmtd042iz0 yPQLGpl5MQrCDr1S9dDNXVwZidg1teRDfBhu3xVvThj5b0+SGgbjNK0HuvwhbbYpkKap 71Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=fTc+nqctqGyeIWTSzskTRZNdD2E/CoCwkDIgQhLo3X4=; b=thvG4HhTCDJhKDDwoi6lsCv5BAYWxbp7UaiqwI+q5deesg8dayGiJvnRvglhqAvoKe XPiC4FqCCsXBIqxKFPXITeMrYe6RhhKoLUgxadV9Dz2nXVbGQFUHJlnpVh6WatH8+Fp+ V/mnbzlnZ7+p8KVlc/hFnA5AWKfOCTO/JlgwIeUkIq02BPoybLEpbWS6bRY892rozjun wW01FwyzMKh+YGiVdEQGPnaMMFBkoAdp3Frsc4oQOtufbL6rEYB9S2qtWP2+SG3hYPS8 5ehkkS6XADR0V+QCYe4OSXlnP6Cau9E7BJ2s5wTZZRHGGiEXINzoTX8uE9Wdnlm4SZtx kkeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lciJIcdu; spf=pass (google.com: domain of libc-alpha-return-89005-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-89005-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z28si10568716pgc.174.2018.01.10.04.49.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 04:49:56 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-89005-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=lciJIcdu; spf=pass (google.com: domain of libc-alpha-return-89005-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-89005-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=LAJ98B1l3U4CBo2Iv6amFP0F7bae6QD 4A05MJ8EBdWA0T3w2ZraKEpv48AIKp58mHw5ZtttpODA9r+YG366+vFONF3WjSjh cnpg3Oj9d0JU3CkPocSqre9fT0BRff0KUHcV9Xr99MCoxeikzKXTA/htXUo580Ca rrI3M0/zsptE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=6ph7VqZ1AxDiGr05EPRNi9H7djE=; b=lciJI cduK2nx/gCBf1L0itC1KBf0d//JyOnLfU6DSDPKemCBKl4UkJmDg7qbxuUx5RmZb T777oGl7A6U1T9riEoEzv8Ofik3Raok9jn9+gD//LCyAzfThb165FQrRpCdt2O4G cFecfKpCc7L+dTIkFfMouhtUGT1hOQSoroX2zs= Received: (qmail 129960 invoked by alias); 10 Jan 2018 12:48:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 120627 invoked by uid 89); 10 Jan 2018 12:48:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*rth X-HELO: mail-qt0-f195.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fTc+nqctqGyeIWTSzskTRZNdD2E/CoCwkDIgQhLo3X4=; b=hTvFYlcJWYKmMTLnGvUyAp8fbDawhNXjsEpqNsSgfItQfXE5Vg1i9kr7/8rfeZ1RsH S5oyag+5JBwt9SNdwgq0XoE5Ap9SuO11Pn59AUsSNp08H1RmGkCiI/FXPuBipaCvBovq c9rP/5iCIlzjgi5z9S2D6t/dldWjQRPx85a58oOFmdXrdsC8EMvr3T/aCNA5Zx4pgL56 25GAZxl0lbmILMQm5LcrYtq0tDZH9FP5xAPRthe0ulXkeR421sjYGG4bv75AdZueF5EA Lvr3zJ8jJwrwQp5SMToNLWybqbsPKSxdFyB4U+N2XWS08shdnfJyjXcr8BoxEDJpAmv1 1Lkw== X-Gm-Message-State: AKwxytfC1uNbrxYJKPwf7qgCapPhhALhYL5dYd8N5gtOPHpwwvggwUfu vg0h+na0DIqxBTQzfzx3Sr9sDMgUXkQ= X-Received: by 10.200.5.10 with SMTP id u10mr26968140qtg.103.1515588490881; Wed, 10 Jan 2018 04:48:10 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Richard Henderson Subject: [PATCH v3 01/18] Parameterize op_t from memcopy.h Date: Wed, 10 Jan 2018 10:47:45 -0200 Message-Id: <1515588482-15744-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1515588482-15744-1-git-send-email-adhemerval.zanella@linaro.org> References: <1515588482-15744-1-git-send-email-adhemerval.zanella@linaro.org> From: Richard Henderson Basically moves op_t definition out to an specific header, adds the attribute 'may-alias', and cleanup its duplicated definitions. It lead to inclusion of tilegx32 gmp-mparam.h similar to x32 so op_t can be define as a long long (from _LONG_LONG_LIMB). Checked with a build and check with run-built-tests=no for all major Linux ABIs (alpha, aarch64, arm, hppa, i686, ia64, m68k, microblaze, mips, mips64, nios2, powerpc, powerpc64le, s390x, sh4, sparc64, tilegx, and x86_64). Richard Henderson Adhemerval Zanella * sysdeps/generic/string-optype.h: New file. * sysdeps/generic/memcopy.h: Include it. * string/memcmp.c (op_t): Remove define. * sysdeps/tile/memcmp.c (op_t): Likewise. * sysdeps/tile/memcopy.h (op_t): Likewise. * sysdeps/tile/tilegx32/gmp-mparam.h: New file. --- string/memcmp.c | 1 - sysdeps/generic/memcopy.h | 7 +++---- sysdeps/generic/string-optype.h | 31 +++++++++++++++++++++++++++++++ sysdeps/tile/memcmp.c | 1 - sysdeps/tile/memcopy.h | 7 ------- sysdeps/tile/tilegx32/gmp-mparam.h | 30 ++++++++++++++++++++++++++++++ 6 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 sysdeps/generic/string-optype.h create mode 100644 sysdeps/tile/tilegx32/gmp-mparam.h -- 2.7.4 diff --git a/string/memcmp.c b/string/memcmp.c index aea5129..4fd2f83 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 c0d8da3..c7e9cc9 100644 --- a/sysdeps/generic/memcopy.h +++ b/sysdeps/generic/memcopy.h @@ -56,10 +56,9 @@ [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 0000000..1324070 --- /dev/null +++ b/sysdeps/generic/string-optype.h @@ -0,0 +1,31 @@ +/* Define a type to use for word access. Generic version. + Copyright (C) 2018 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 + +/* Use the existing parameterization from gmp as a default. */ +#include + +#ifdef _LONG_LONG_LIMB +typedef unsigned long long int __attribute__((__may_alias__)) op_t; +#else +typedef unsigned long int __attribute__((__may_alias__)) op_t; +#endif + +#endif /* string-optype.h */ diff --git a/sysdeps/tile/memcmp.c b/sysdeps/tile/memcmp.c index b7cf00a..89fff57 100644 --- a/sysdeps/tile/memcmp.c +++ b/sysdeps/tile/memcmp.c @@ -45,7 +45,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/tile/memcopy.h b/sysdeps/tile/memcopy.h index 0c357c1..748f648 100644 --- a/sysdeps/tile/memcopy.h +++ b/sysdeps/tile/memcopy.h @@ -22,10 +22,3 @@ /* The tilegx implementation of memcpy is safe to use for memmove. */ #undef MEMCPY_OK_FOR_FWD_MEMMOVE #define MEMCPY_OK_FOR_FWD_MEMMOVE 1 - -/* Support more efficient copying on tilegx32, which supports - long long as a native 64-bit type. */ -#if __WORDSIZE == 32 -# undef op_t -# define op_t unsigned long long int -#endif diff --git a/sysdeps/tile/tilegx32/gmp-mparam.h b/sysdeps/tile/tilegx32/gmp-mparam.h new file mode 100644 index 0000000..7d1cb98 --- /dev/null +++ b/sysdeps/tile/tilegx32/gmp-mparam.h @@ -0,0 +1,30 @@ +/* Compiler/machine parameter header file. TileGX32 version. + + Copyright (C) 2018 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 + . */ + +#if defined __GMP_H__ && ! defined _LONG_LONG_LIMB +#error "Included too late for _LONG_LONG_LIMB to take effect" +#endif + +#define _LONG_LONG_LIMB +#define BITS_PER_MP_LIMB 64 +#define BYTES_PER_MP_LIMB 8 +#define BITS_PER_LONGINT 32 +#define BITS_PER_INT 32 +#define BITS_PER_SHORTINT 16 +#define BITS_PER_CHAR 8