From patchwork Wed Dec 21 23:05:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 707992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tkVfw1JXFz9t1b for ; Thu, 22 Dec 2016 10:07:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="T9/QM5AH"; dkim-atps=neutral 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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=aMaF9b7kj+eK66hYzYqCRrtww08MAoJ 5aaeEFCLEi6w0t1p0yFYbUGMWr8Nf2lk2XSvbZNllonYXOP5qnjwwJXJanmbFGax sXbmLUkK00MweOct2e58yncgfEU1WSG28KsMrVk24TSCujB6Yv3AkWmxexSMhlQA cEABaqvZStvI= 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:subject:date:message-id:in-reply-to :references; s=default; bh=7ZhIc/nAS+cI6gd0F/7NnmMRWS8=; b=T9/QM 5AHEKKmC0y/8xJNFWSIaVwd6gavrfZOH3lCouoqh1TRXNywBX19+auQvYjvF10DI JevS2wrBsQQ1klE+7wf8FCbn1TC1vsP6NWB8oBGmbCXoCLtWIJf7O6OhWdkRUrwq e2GH5S0OunFzd176MVTRCt/efh5a/45AKtnb38= Received: (qmail 51579 invoked by alias); 21 Dec 2016 23:06:22 -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 51239 invoked by uid 89); 21 Dec 2016 23:06:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=1, 25 X-HELO: mail-pg0-f66.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=Ho8JZcLIyJzs/d5N0DMC3qd1qt2x60v+0p51gmxVt+Q=; b=Yta1eIJqCiMqw2Bo+U1zaE9dBWPvoOXrS3j3e38br85pKW4WfVI56WczgseT5O/A22 Ulq3Fw1QZ67l7iAQZLb3F7s0o2xraH69aRv3KL2wjjlAsIYY28NqbwkqeAqfnbHT36zb EZUlnfUQ8PsUQWhrSPCKnCJgEOmwXdzU7AUcimeacauwvFNqrA4scQSrSmPRH7HM5Kl4 gGVTw6BeAaTXOEcWw10FDLtnm5XhXuce8lGtxhFWeaGGf/wCG207GZpa/Ugo2hv8/yOY 64PDha2vTOUkVykcVFpWYEPB9K2c8tZoqkIynCs+Yxpt5hwJJOSTnaiwXXr3H56kLLFn t+Xw== X-Gm-Message-State: AIkVDXLZzVNhS3PwqdjHfvBb5upSd/46JISYJGb4rxiKR+aI0j8XXm4aX4FULaqbUt4Q0Q== X-Received: by 10.98.31.14 with SMTP id f14mr6223364pff.27.1482361569431; Wed, 21 Dec 2016 15:06:09 -0800 (PST) From: Richard Henderson To: libc-alpha@sourceware.org Subject: [PATCH v2 02/16] Parameterize OP_T_THRES from memcopy.h Date: Wed, 21 Dec 2016 15:05:51 -0800 Message-Id: <20161221230605.28638-3-rth@twiddle.net> In-Reply-To: <20161221230605.28638-1-rth@twiddle.net> References: <20161221230605.28638-1-rth@twiddle.net> * sysdeps/generic/memcopy.h (OP_T_THRES): Move... * sysdeps/generic/string-opthr.h: ... here; new file. * sysdeps/i386/memcopy.h (OP_T_THRES): Move... * sysdeps/i386/string-opthr.h: ... here; new file. * sysdeps/m68k/memcopy.h (OP_T_THRES): Remove. * sysdeps/powerpc/powerpc32/power4/memcopy.h (OP_T_THRES): Remove. --- sysdeps/generic/memcopy.h | 4 +--- sysdeps/generic/string-opthr.h | 25 +++++++++++++++++++++++++ sysdeps/i386/memcopy.h | 3 --- sysdeps/i386/string-opthr.h | 25 +++++++++++++++++++++++++ sysdeps/m68k/memcopy.h | 3 --- sysdeps/powerpc/powerpc32/power4/memcopy.h | 5 ----- 6 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 sysdeps/generic/string-opthr.h create mode 100644 sysdeps/i386/string-opthr.h diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h index 38f27a8..a720e5e 100644 --- a/sysdeps/generic/memcopy.h +++ b/sysdeps/generic/memcopy.h @@ -58,6 +58,7 @@ /* Type to use for aligned memory operations. */ #include +#include #define OPSIZ (sizeof(op_t)) @@ -190,9 +191,6 @@ extern void _wordcopy_bwd_dest_aligned (long int, long int, size_t) #endif -/* Threshold value for when to enter the unrolled loops. */ -#define OP_T_THRES 16 - /* Set to 1 if memcpy is safe to use for forward-copying memmove with overlapping addresses. This is 0 by default because memcpy implementations are generally not safe for overlapping addresses. */ diff --git a/sysdeps/generic/string-opthr.h b/sysdeps/generic/string-opthr.h new file mode 100644 index 0000000..f4f4a33 --- /dev/null +++ b/sysdeps/generic/string-opthr.h @@ -0,0 +1,25 @@ +/* string-opthr.h -- Define a threshold for word access. Generic version. + Copyright (C) 2016 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_OPTHR_H +#define STRING_OPTHR_H 1 + +/* Threshold value for when to enter the unrolled loops. */ +#define OP_T_THRES 16 + +#endif /* string-opthr.h */ diff --git a/sysdeps/i386/memcopy.h b/sysdeps/i386/memcopy.h index 2fe98fa..f59f8a8 100644 --- a/sysdeps/i386/memcopy.h +++ b/sysdeps/i386/memcopy.h @@ -19,9 +19,6 @@ #include -#undef OP_T_THRES -#define OP_T_THRES 8 - #undef BYTE_COPY_FWD #define BYTE_COPY_FWD(dst_bp, src_bp, nbytes) \ do { \ diff --git a/sysdeps/i386/string-opthr.h b/sysdeps/i386/string-opthr.h new file mode 100644 index 0000000..f92c61b --- /dev/null +++ b/sysdeps/i386/string-opthr.h @@ -0,0 +1,25 @@ +/* string-opthr.h -- Define a threshold for word access. i386 version. + Copyright (C) 2016 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 I386_STRING_OPTHR_H +#define I386_STRING_OPTHR_H 1 + +/* Threshold value for when to enter the unrolled loops. */ +#define OP_T_THRES 8 + +#endif /* I386_STRING_OPTHR_H */ diff --git a/sysdeps/m68k/memcopy.h b/sysdeps/m68k/memcopy.h index 33a2064..751efff 100644 --- a/sysdeps/m68k/memcopy.h +++ b/sysdeps/m68k/memcopy.h @@ -21,9 +21,6 @@ #if defined(__mc68020__) || defined(mc68020) -#undef OP_T_THRES -#define OP_T_THRES 16 - /* WORD_COPY_FWD and WORD_COPY_BWD are not symmetric on the 68020, because of its weird instruction overlap characteristics. */ diff --git a/sysdeps/powerpc/powerpc32/power4/memcopy.h b/sysdeps/powerpc/powerpc32/power4/memcopy.h index a06a8c9..9cff24e 100644 --- a/sysdeps/powerpc/powerpc32/power4/memcopy.h +++ b/sysdeps/powerpc/powerpc32/power4/memcopy.h @@ -51,11 +51,6 @@ [I fail to understand. I feel stupid. --roland] */ - -/* Threshold value for when to enter the unrolled loops. */ -#undef OP_T_THRES -#define OP_T_THRES 16 - /* Copy exactly NBYTES bytes from SRC_BP to DST_BP, without any assumptions about alignment of the pointers. */ #undef BYTE_COPY_FWD