From patchwork Thu Oct 5 13:51:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 114941 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp251064edb; Thu, 5 Oct 2017 06:52:07 -0700 (PDT) X-Received: by 10.99.127.89 with SMTP id p25mr2339494pgn.196.1507211527482; Thu, 05 Oct 2017 06:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507211527; cv=none; d=google.com; s=arc-20160816; b=Iy19VcjimSKdna1A6ZJGjnj6oRF0psDeKMs1+JZ+eko5qLKXptkzzjm5owdZYE+qBp SP/WYbNVQzv7Qie9y29Csr/7+5phejm/1KEo1YkFrQfxpCwiGg9z6UR6e0puyzQu4Phe 4EEwcNQgnKr5Sdmy6G2eQHXT/LbkN0rSchGYqLCCXyusEzm3NAOmsHHaeFOrqnoB9dsj q6PZAxWFFS1RZh0DKWXiZKLjQV8Hho2XXHPWUWkYveIybVEEZSEVy9/aY3AbhaSMnm8F BzSYpge94AI20p5OOJkJCGlXPt8dpUcvS0e98ehxjW3kyNYgCbS1biPhvybh1YMp4mny a2Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject: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=5tYOK8g/WMIe6FW30LDhkHfpTBcwCNKh6AxH5uBebvg=; b=dza282InUX/gceUqERtiCJdF5gFSR84ZY7FGVL2ovGKuREsNwCxyrAWlsGPf3HFL4E vE+5bmVatl/WX4hOwhucUOGEReVoxy+/+3ohghq4Vjd0m9Lqu5mRftqirrVy6hZWdYMV v9wNVGI70MpmgrFRvUTySiptvQqoWUzb6zImeJr/8/SufFIOcIndSgW79G8vn9mCCard lteVoSYVp8y+jWPUUtpij8E5Ib4EiCJtAsk5XwTUG/ClapF9mjcPo1W/EmK2k6YKV5gR B2cBOWWDa/48htiiIUB+ov9sPBJvyqhsf1FJW8oVCWnv9bwKG5COG9xCtj21JJmkQc/J QSkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=u2dpQ3h7; spf=pass (google.com: domain of libc-alpha-return-85441-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85441-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 m7si3668218plt.61.2017.10.05.06.52.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 06:52:07 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-85441-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=u2dpQ3h7; spf=pass (google.com: domain of libc-alpha-return-85441-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85441-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:subject:date:message-id; q=dns; s= default; b=hG+LOhmTEC3FTeYkUQ4Mfkk8KzkkUkepOMd5JezTkiyCd/Xkh/bTb 939W/Soc1fMH5aMubktUo0rEobovzfWtd9JEWgVFi4QqdUM694AhUvavTUmBaVM7 cr9ytJB8/liTG/rL5PqzmVfc6edEBjrekt5OZy0croeUvFMLqOxzvU= 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; s=default; bh=tG7Od6MSMMcns9QwJQQ8yKMYA4o=; b=u2dpQ3h70KpkWuo37NFQSm//od54 CedCUJGCPSGT5cNdjvkhvjahSlAXcPVdR9XONDYL/1vEUZY7HEZGNZFcHyTMH2IE JkB3DA1TGcC6Wjc833Pwr2HG/045FJIuICwZEZdgVt6js4JEqOYSIApPyGh0s2D7 8JRDFP4KiqAjtRU= Received: (qmail 130470 invoked by alias); 5 Oct 2017 13:51:27 -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 129863 invoked by uid 89); 5 Oct 2017 13:51:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=8, 5, xy X-HELO: mail-qk0-f178.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:subject:date:message-id; bh=5tYOK8g/WMIe6FW30LDhkHfpTBcwCNKh6AxH5uBebvg=; b=r7XNZRzhs7erAODqE2Xwj1qoKYt4RQVyTVfC3kYX7n6cBKQL7bmApWPD+11hirVIAo d8bP4LHtC+0PJJpUEB/PBqQ8DRdPd+FvPJwQ/HCvLCYCwKufR5f/KiTz4D7mjvhDShQ+ J0WqvWkD9r5OWh6EnILYR+Ca2GepNCd0gHtItD+b6lzSZvRC2oMSgANezQsYlSjAUPMu 2Rf3JT3yfqnbuqMixjkJZuRUJ0YEVkJbGky4ApQc0klHUOHElb9FonA7YCkRfB0VDpv7 +CN1zheSv1q7DEadA97TRRTX6+8+Z7YvLhpBpgLdhO2AmodTJly9mCa1bbZ+FzK0VvRp ltVg== X-Gm-Message-State: AMCzsaUZhyELd+0tfVGH4KhIoAl900thheMJmse/pPyJPbScaduPZGs6 KGKekvBbs1sV/SWW8BOKKkdl2olNuM4= X-Google-Smtp-Source: AOwi7QBN9IncjHTor2Ya2UuyIwzluiegLxLS/+1hi4GSdcrvYioQZnkeDYnOxluvFIQpt3dCsd9RMA== X-Received: by 10.55.25.85 with SMTP id k82mr28032219qkh.223.1507211480074; Thu, 05 Oct 2017 06:51:20 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/4] sparc: Implement memcpy/mempcpy ifunc selection in C Date: Thu, 5 Oct 2017 10:51:09 -0300 Message-Id: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> This patch refactor the SPARC64 ifunc selector to a C implementation. The x86_64 implementation is used as default, which resulted in common definitions (ifunc-init.h) used on both architectures. No functional change is expected, including ifunc resolution rules. Checked on sparc64-linux-gnu, sparcv9-linux-gnu and x86_64-linux-gnu. * sysdeps/generic/ifunc-init.h: New file. * sysdeps/sparc/init-arch.h: Likewise. * sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S: New file. * sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c: Likewise. * sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c: Likewise. * sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-mempcpy.S: Likewise. * sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy.c: Likewise. * sysdeps/sparc/sparc64/multiarch/mempcpy.c: Likewise. * sysdeps/sparc/sparc64/multiarch/rtld-mempcpy.S: Likewise. * sysdeps/sparc/sparc-ifunc.h (sparc_libc_ifunc_redirected): New macro. * sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memcpy-ultra1. * sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memcpy-ultra1. * sysdeps/sparc/sparc64/multiarch/memcpy.S: Remove file. * sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S: Likewise. * sysdeps/x86/init-arch.h: Use generic ifunc-init.h. --- ChangeLog | 24 +++ sysdeps/generic/ifunc-init.h | 54 +++++++ sysdeps/sparc/init-arch.h | 23 +++ sysdeps/sparc/sparc-ifunc.h | 3 + sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile | 3 +- .../sparc32/sparcv9/multiarch/memcpy-ultra1.S | 35 +++++ sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S | 4 - sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c | 1 + sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c | 1 + .../sparc/sparc32/sparcv9/multiarch/rtld-mempcpy.S | 1 + sysdeps/sparc/sparc64/multiarch/Makefile | 3 +- sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h | 40 +++++ sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S | 35 +++++ sysdeps/sparc/sparc64/multiarch/memcpy.S | 167 --------------------- sysdeps/sparc/sparc64/multiarch/memcpy.c | 38 +++++ sysdeps/sparc/sparc64/multiarch/mempcpy.c | 47 ++++++ sysdeps/sparc/sparc64/multiarch/rtld-mempcpy.S | 1 + sysdeps/x86/init-arch.h | 40 +---- 18 files changed, 308 insertions(+), 212 deletions(-) create mode 100644 sysdeps/generic/ifunc-init.h create mode 100644 sysdeps/sparc/init-arch.h create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-mempcpy.S create mode 100644 sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h create mode 100644 sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S delete mode 100644 sysdeps/sparc/sparc64/multiarch/memcpy.S create mode 100644 sysdeps/sparc/sparc64/multiarch/memcpy.c create mode 100644 sysdeps/sparc/sparc64/multiarch/mempcpy.c create mode 100644 sysdeps/sparc/sparc64/multiarch/rtld-mempcpy.S -- 2.7.4 diff --git a/sysdeps/generic/ifunc-init.h b/sysdeps/generic/ifunc-init.h new file mode 100644 index 0000000..59d5ac6 --- /dev/null +++ b/sysdeps/generic/ifunc-init.h @@ -0,0 +1,54 @@ +/* IFUNC generic definitions. + This file is part of the GNU C Library. + Copyright (C) 2017 Free Software Foundation, Inc. + + 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 + . */ + +/* These macros are used to implement ifunc selection in C. To implement + an ifunc function, foo, which returns the address of __foo_impl1 or + __foo_impl2: + + #define foo __redirect_foo + #include + #undef foo + #define SYMBOL_NAME foo + #include + + extern __typeof (REDIRECT_NAME) OPTIMIZE (impl1) attribute_hidden; + extern __typeof (REDIRECT_NAME) OPTIMIZE (impl2) attribute_hidden; + + static inline void * + foo_selector (void) + { + if (condition) + return OPTIMIZE (impl2); + + return OPTIMIZE (impl1); + } + + libc_ifunc_redirected (__redirect_foo, foo, IFUNC_SELECTOR ()); +*/ + +#define PASTER1(x,y) x##_##y +#define EVALUATOR1(x,y) PASTER1 (x,y) +#define PASTER2(x,y) __##x##_##y +#define EVALUATOR2(x,y) PASTER2 (x,y) + +/* Basically set '__redirect_' to use as type definition, + '___' as the optimized implementation and + '_ifunc_selector' as the IFUNC selector. */ +#define REDIRECT_NAME EVALUATOR1 (__redirect, SYMBOL_NAME) +#define OPTIMIZE(name) EVALUATOR2 (SYMBOL_NAME, name) +#define IFUNC_SELECTOR EVALUATOR1 (SYMBOL_NAME, ifunc_selector) diff --git a/sysdeps/sparc/init-arch.h b/sysdeps/sparc/init-arch.h new file mode 100644 index 0000000..30972cd --- /dev/null +++ b/sysdeps/sparc/init-arch.h @@ -0,0 +1,23 @@ +/* IFUNC common definition for SPARC64. + This file is part of the GNU C Library. + Copyright (C) 2017 Free Software Foundation, Inc. + + 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 + . */ + +#include +#include + +#define INIT_ARCH() +#include diff --git a/sysdeps/sparc/sparc-ifunc.h b/sysdeps/sparc/sparc-ifunc.h index 4b1ea00..3d81b52 100644 --- a/sysdeps/sparc/sparc-ifunc.h +++ b/sysdeps/sparc/sparc-ifunc.h @@ -162,6 +162,9 @@ END (__##name) #else /* __ASSEMBLER__ */ +# define sparc_libc_ifunc_redirected(redirected_name, name, expr) \ + __ifunc (redirected_name, name, expr(hwcap), int hwcap, INIT_ARCH) + # define sparc_libm_ifunc(name, expr) \ __ifunc (name, name, expr, int hwcap, libm_ifunc_init) diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile index 4ad7aff..ca44798 100644 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile @@ -8,5 +8,6 @@ endif ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ - memset-niagara1 memcpy-niagara4 memset-niagara4 + memset-niagara1 memcpy-niagara4 memset-niagara4 \ + memcpy-ultra1 endif diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S new file mode 100644 index 0000000..b56438d --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S @@ -0,0 +1,35 @@ +/* Default SPARC32 memcpy implementation. + Copyright (C) 2017 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 IS_IN (libc) + +# include + +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(name) +# undef weak_alias +# define weak_alias(x, y) +# undef libc_hidden_def +# define libc_hidden_def(name) + +# define memcpy __memcpy_ultra1 +# define __mempcpy __mempcpy_ultra1 + +#endif + +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S deleted file mode 100644 index 14df91e..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S +++ /dev/null @@ -1,4 +0,0 @@ -#define ASI_PNF 0x82 -#define ASI_BLK_P 0xf0 -#define XCC icc -#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c new file mode 100644 index 0000000..369acac --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c new file mode 100644 index 0000000..616a538 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-mempcpy.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-mempcpy.S new file mode 100644 index 0000000..f18c9f9 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-mempcpy.S @@ -0,0 +1 @@ +/* rtld-mempcpy is implemented by rtld-memcpy.S. */ diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile index 55b757f..4e52526 100644 --- a/sysdeps/sparc/sparc64/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/multiarch/Makefile @@ -8,7 +8,8 @@ endif ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ - memset-niagara1 memcpy-niagara4 memset-niagara4 + memset-niagara1 memcpy-niagara4 memset-niagara4 \ + memcpy-ultra1 endif ifeq ($(subdir),stdlib) diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h new file mode 100644 index 0000000..f497108 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h @@ -0,0 +1,40 @@ +/* Common definition for memcpy and mempcpy implementation. + All versions must be listed in ifunc-impl-list.c. + Copyright (C) 2017 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 + . */ + +#include + +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara2) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra3) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden; + +static inline void * +IFUNC_SELECTOR (int hwcap) +{ + if (hwcap & HWCAP_SPARC_CRYPTO) + return OPTIMIZE (niagara4); + if (hwcap & HWCAP_SPARC_N2) + return OPTIMIZE (niagara2); + if (hwcap & HWCAP_SPARC_BLKINIT) + return OPTIMIZE (niagara1); + if (hwcap & HWCAP_SPARC_ULTRA3) + return OPTIMIZE (ultra3); + return OPTIMIZE (ultra1); +} diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S new file mode 100644 index 0000000..1a0aaf3 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S @@ -0,0 +1,35 @@ +/* Default SPARC64 memcpy implementation. + Copyright (C) 2017 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 IS_IN (libc) + +# include + +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(name) +# undef weak_alias +# define weak_alias(x, y) +# undef libc_hidden_def +# define libc_hidden_def(name) + +# define memcpy __memcpy_ultra1 +# define __mempcpy __mempcpy_ultra1 + +#endif + +#include diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.S b/sysdeps/sparc/sparc64/multiarch/memcpy.S deleted file mode 100644 index b6396ee..0000000 --- a/sysdeps/sparc/sparc64/multiarch/memcpy.S +++ /dev/null @@ -1,167 +0,0 @@ -/* Multiple versions of memcpy - All versions must be listed in ifunc-impl-list.c. - Copyright (C) 2010-2017 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 - . */ - -#include - -#if IS_IN (libc) - .text -ENTRY(memcpy) - .type memcpy, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_N2, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memcpy_niagara4), %o1 - xor %o1, %gdop_lox10(__memcpy_niagara4), %o1 -# else - set __memcpy_niagara4, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memcpy_niagara2), %o1 - xor %o1, %gdop_lox10(__memcpy_niagara2), %o1 -# else - set __memcpy_niagara2, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_ULTRA3, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memcpy_niagara1), %o1 - xor %o1, %gdop_lox10(__memcpy_niagara1), %o1 -# else - set __memcpy_niagara1, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__memcpy_ultra3), %o1 - xor %o1, %gdop_lox10(__memcpy_ultra3), %o1 -# else - set __memcpy_ultra3, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__memcpy_ultra1), %o1 - xor %o1, %gdop_lox10(__memcpy_ultra1), %o1 -# else - set __memcpy_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(memcpy) - -ENTRY(__mempcpy) - .type __mempcpy, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_N2, %g0 -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_niagara4), %o1 - xor %o1, %gdop_lox10(__mempcpy_niagara4), %o1 -# else - set __mempcpy_niagara4, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_niagara2), %o1 - xor %o1, %gdop_lox10(__mempcpy_niagara2), %o1 -# else - set __mempcpy_niagara2, %o1 -# endif - ba 10f - nop -1: be 1f - andcc %o0, HWCAP_SPARC_ULTRA3, %g0 -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_niagara1), %o1 - xor %o1, %gdop_lox10(__mempcpy_niagara1), %o1 -# else - set __mempcpy_niagara1, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_ultra3), %o1 - xor %o1, %gdop_lox10(__mempcpy_ultra3), %o1 -# else - set __mempcpy_ultra3, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__mempcpy_ultra1), %o1 - xor %o1, %gdop_lox10(__mempcpy_ultra1), %o1 -# else - set __mempcpy_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__mempcpy) - -libc_hidden_builtin_def (memcpy) - -libc_hidden_def (__mempcpy) -weak_alias (__mempcpy, mempcpy) -libc_hidden_builtin_def (mempcpy) - -#undef libc_hidden_builtin_def -#define libc_hidden_builtin_def(name) -#undef weak_alias -#define weak_alias(x, y) -#undef libc_hidden_def -#define libc_hidden_def(name) - -#define memcpy __memcpy_ultra1 -#define __mempcpy __mempcpy_ultra1 - -#endif - -#include "../memcpy.S" diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.c b/sysdeps/sparc/sparc64/multiarch/memcpy.c new file mode 100644 index 0000000..2c3d3f3 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memcpy.c @@ -0,0 +1,38 @@ +/* Multiple versions of memcpy. + All versions must be listed in ifunc-impl-list.c. + Copyright (C) 2017 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 IS_IN (libc) +# define memcpy __redirect_memcpy +# include +# undef memcpy + +# include + +# define SYMBOL_NAME memcpy +# include "ifunc-memcpy.h" + +sparc_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR); + +/* It essentially does libc_hidden_builtin_def (memcpy) and redirect + the internal symbol to ifunc implementation. */ +# ifdef SHARED +__hidden_ver1 (memcpy, __GI_memcpy, __redirect_memcpy) + __attribute__ ((visibility ("hidden"))); +# endif +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/mempcpy.c b/sysdeps/sparc/sparc64/multiarch/mempcpy.c new file mode 100644 index 0000000..f52dca6 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/mempcpy.c @@ -0,0 +1,47 @@ +/* Multiple versions of memcpy + All versions must be listed in ifunc-impl-list.c. + Copyright (C) 2017 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 IS_IN (libc) +# define mempcpy __redirect_mempcpy +# define __mempcpy __redirect___mempcpy +# define NO_MEMPCPY_STPCPY_REDIRECT +# define __NO_STRING_INLINES +# include +# undef mempcpy +# undef __mempcpy + +# include + +# define SYMBOL_NAME mempcpy +# include "ifunc-memcpy.h" + +sparc_libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR); + +weak_alias (__mempcpy, mempcpy) + +/* It essentially does libc_hidden_builtin_def (mempcpy) and + and libc_hidden_def (__mempcpy) and redirects the internal symbol to + ifunc implementation. */ +# ifdef SHARED +__hidden_ver1 (__mempcpy, __GI___mempcpy, __redirect___mempcpy) + __attribute__ ((visibility ("hidden"))); +__hidden_ver1 (mempcpy, __GI_mempcpy, __redirect_mempcpy) + __attribute__ ((visibility ("hidden"))); +# endif +#endif diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-mempcpy.S b/sysdeps/sparc/sparc64/multiarch/rtld-mempcpy.S new file mode 100644 index 0000000..f18c9f9 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/rtld-mempcpy.S @@ -0,0 +1 @@ +/* rtld-mempcpy is implemented by rtld-memcpy.S. */ diff --git a/sysdeps/x86/init-arch.h b/sysdeps/x86/init-arch.h index 15d3f09..9228fe5 100644 --- a/sysdeps/x86/init-arch.h +++ b/sysdeps/x86/init-arch.h @@ -21,45 +21,7 @@ # include #endif -/* These macros are used to implement ifunc selection in C. To implement - an ifunc function, foo, which returns the address of __foo_sse2 or - __foo_avx2: - - #define foo __redirect_foo - #define __foo __redirect___foo - #include - #undef foo - #undef __foo - #define SYMBOL_NAME foo - #include - - extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; - extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden; - - static inline void * - foo_selector (void) - { - if (use AVX2) - return OPTIMIZE (avx2); - - return OPTIMIZE (sse2); - } - - libc_ifunc_redirected (__redirect_foo, foo, foo_selector ()); - -*/ - -#define PASTER1(x,y) x##_##y -#define EVALUATOR1(x,y) PASTER1 (x,y) -#define PASTER2(x,y) __##x##_##y -#define EVALUATOR2(x,y) PASTER2 (x,y) - -/* Basically set '__redirect_' to use as type definition, - '___' as the optimized implementation and - '_ifunc_selector' as the IFUNC selector. */ -#define REDIRECT_NAME EVALUATOR1 (__redirect, SYMBOL_NAME) -#define OPTIMIZE(name) EVALUATOR2 (SYMBOL_NAME, name) -#define IFUNC_SELECTOR EVALUATOR1 (SYMBOL_NAME, ifunc_selector) +#include #ifndef __x86_64__ /* Due to the reordering and the other nifty extensions in i686, it is From patchwork Thu Oct 5 13:51:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 114940 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp250870edb; Thu, 5 Oct 2017 06:51:55 -0700 (PDT) X-Received: by 10.98.42.77 with SMTP id q74mr23213003pfq.272.1507211515401; Thu, 05 Oct 2017 06:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507211515; cv=none; d=google.com; s=arc-20160816; b=xaSSO5mfTifRMhPcHn5tztFv+CoUGarbBqMrn6y48t+yNsx7crZQXKi5u1XE88uWCf smySylTQSylONAKRb/Zh1Gu6GiTPY5uj1lKLiuKgQcG39sNJnM4P2WFb4c5uovuR+wI/ vzQAoIqGTRljt3qVFvdeHATzLRLRDxXUZSnZbaH2heaqIvVCRXTsHU1lDFcfLKZu8csP r9DHtaiuf7O83xcaMBSBnQJlodYEhCburBdKVYdH0SknwR5P7pgSZNaSULmhjitb7KeU fIOkQ15Jj7ooOwhAcFzMqLJ5uPvWSzc1hmjaTnEflEVXVMmbre6aH4tcBa0M+47DXNV3 jj9g== 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: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=qy4Iz3IoxdrautJYUJ/RJSQTXSs/NtsR9iasYpI9c8g=; b=MF4JdNGR9wCCHERaZ9VtT/PqWcpIGVnJNJlyRXLElqfeNcV261FbCJooK5zHJsDSGC rvtRF/XScjnNwKG1M+ax7o7/HjgtfzpdZC/JU0PzNzKrr4oYKOFxl0XCypUBlvYJdlYi sOrATvwrCOgT39weVcgT1AyPghRsX9NbtBm/Kgi7dXIwaUh5o9T69/GLD8MPwf3E+4xy oQJrPqm2DoUEFJK2kXDm25BFPCsTvJhECjp6BqNKbqNYTedv0VLQoxVBeLI8Vt3mtCaq OgFlT/4vF+ilw8+tzcDN3skJuwPthnBy+HH+Mo+s1qlij1Q8sgMGdJouo0gEojOGJopy OFXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=NNHI5g5a; spf=pass (google.com: domain of libc-alpha-return-85440-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85440-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 y7si12984154plt.42.2017.10.05.06.51.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 06:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-85440-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=NNHI5g5a; spf=pass (google.com: domain of libc-alpha-return-85440-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85440-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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=TvQ6gjutqAuhNGtCZaNSAbL9CMmjOAX htOgNkrjH6lzI0B+pJ76CDqv78JL84QQRnkypNZgxiTBU6BSX2tyuSCJxXa5kboG P6fFfNsaebUataGmrD6WiWHprIFrzy/++OXttREkwhXA/2+cF+xncM9yk9s+gEEO lE0FifSo6MZo= 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=O4FEsANt+DO9+PPIGsW0JU0XGKM=; b=NNHI5 g5a3+1EREStbpIHiHwuIOWGT1DCLxEX9COLXDjn+0fGIu3a/vyRXohxVIAq1G/4e sxZ2uUUqeT7y5ohq8By7Rf5P5Nhazs/FBVzzYGnihosfb/bR6Z3b2MtIE09Z1pya YuOOYZJjROMLHX79+z8Mxm7uSu8mJ9faZRqYXk= Received: (qmail 130257 invoked by alias); 5 Oct 2017 13:51:27 -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 129861 invoked by uid 89); 5 Oct 2017 13:51:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=95 X-HELO: mail-qk0-f170.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:subject:date:message-id:in-reply-to :references; bh=qy4Iz3IoxdrautJYUJ/RJSQTXSs/NtsR9iasYpI9c8g=; b=uAf7lkRQ8okhiRHzVvHBoZUuCUdbDRaqZF05c9tGM3RkcLSZ9rbsQ8fZQEbAl1kqit cLuoXJQ+rMXcpVirR7S3geA50SQJmEU3KzpLTGLwkC0zLeNYgRryGtDrXhjmGh3dLXzK E2YH08rpTlw5D1p8pvgYorAJHuKpiIOzAgpel5IU7CHsINAkjShebt+W3ah+1ymrFn4D 0qN2LAKo2Vj09ZENxp4VOh+UaTcAI2SxrNpddAZqY2apt0FbL+jDl2eKY85rQLfcXjsH +lYx3ZH2ZNoBn6HLUWZIyCw0kTIwyzt50TNh/LxThlWg3vsLzSxdCef2hNY6vFgIVUx8 /BRQ== X-Gm-Message-State: AMCzsaWNqSrC90to0nu14oyDFoz1it9rqa4hYHhtLLVGmWVjT19gcDjM dPCVRpofnRgx9j7ZXO0lVg2F0KnqX9I= X-Google-Smtp-Source: AOwi7QCWImNlC9anmbYfPb6qO61nFDdf2dKZ3tkfvgnHdaJtXPGE9YbRVxK61IccRWUHvMtHqHkn1A== X-Received: by 10.233.232.8 with SMTP id a8mr20942397qkg.263.1507211481640; Thu, 05 Oct 2017 06:51:21 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] sparc: Implement memset/bzero ifunc selection in C Date: Thu, 5 Oct 2017 10:51:10 -0300 Message-Id: <1507211472-1194-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> References: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> This patch refactor the SPARC64 ifunc selector to a C implementation. No functional change is expected, including ifunc resolution rules. Checked on sparc64-linux-gnu, sparcv9-linux-gnu and x86_64-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memset-ultra1. * sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memset-ultra1. * sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S: New file. * sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c: Likewise. * sysdeps/sparc/sparc64/multiarch/ifunc-memset.h: Likewise. * sysdeps/sparc/sparc64/multiarch/memset-ultra1.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memset.c: Likewise. * sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S: Remove file. * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise. --- ChangeLog | 13 +++ sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile | 2 +- .../sparc32/sparcv9/multiarch/memset-ultra1.S | 33 ++++++ sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S | 4 - sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c | 1 + sysdeps/sparc/sparc64/multiarch/Makefile | 2 +- sysdeps/sparc/sparc64/multiarch/ifunc-memset.h | 34 ++++++ sysdeps/sparc/sparc64/multiarch/memset-ultra1.S | 33 ++++++ sysdeps/sparc/sparc64/multiarch/memset.S | 124 --------------------- sysdeps/sparc/sparc64/multiarch/memset.c | 49 ++++++++ 10 files changed, 165 insertions(+), 130 deletions(-) create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c create mode 100644 sysdeps/sparc/sparc64/multiarch/ifunc-memset.h create mode 100644 sysdeps/sparc/sparc64/multiarch/memset-ultra1.S delete mode 100644 sysdeps/sparc/sparc64/multiarch/memset.S create mode 100644 sysdeps/sparc/sparc64/multiarch/memset.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile index ca44798..e12636b 100644 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile @@ -9,5 +9,5 @@ endif ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ memset-niagara1 memcpy-niagara4 memset-niagara4 \ - memcpy-ultra1 + memcpy-ultra1 memset-ultra1 endif diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S new file mode 100644 index 0000000..4a5508d --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S @@ -0,0 +1,33 @@ +/* Default SPARC64 memset implementation. + Copyright (C) 2017 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 IS_IN (libc) + +# include + +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(name) +# undef weak_alias +# define weak_alias(x, y) + +# define memset __memset_ultra1 +# define __bzero __bzero_ultra1 + +#endif + +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S deleted file mode 100644 index 8f82643..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S +++ /dev/null @@ -1,4 +0,0 @@ -#define ASI_PNF 0x82 -#define ASI_BLK_P 0xf0 -#define XCC icc -#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c new file mode 100644 index 0000000..a6c5734 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile index 4e52526..6e90cba 100644 --- a/sysdeps/sparc/sparc64/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/multiarch/Makefile @@ -9,7 +9,7 @@ endif ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ memset-niagara1 memcpy-niagara4 memset-niagara4 \ - memcpy-ultra1 + memcpy-ultra1 memset-ultra1 endif ifeq ($(subdir),stdlib) diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h new file mode 100644 index 0000000..eaf0fb8 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h @@ -0,0 +1,34 @@ +/* Common definition for memset/bzero implementation. + All versions must be listed in ifunc-impl-list.c. + Copyright (C) 2017 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 + . */ + +#include + +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden; +extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden; + +static inline void * +IFUNC_SELECTOR (int hwcap) +{ + if (hwcap & HWCAP_SPARC_CRYPTO) + return OPTIMIZE (niagara4); + if (hwcap & HWCAP_SPARC_BLKINIT) + return OPTIMIZE (niagara1); + return OPTIMIZE (ultra1); +} diff --git a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S new file mode 100644 index 0000000..728c179 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S @@ -0,0 +1,33 @@ +/* Default SPARC64 memset implementation. + Copyright (C) 2017 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 IS_IN (libc) + +# include + +# undef libc_hidden_builtin_def +# define libc_hidden_builtin_def(name) +# undef weak_alias +# define weak_alias(x, y) + +# define memset __memset_ultra1 +# define __bzero __bzero_ultra1 + +#endif + +#include diff --git a/sysdeps/sparc/sparc64/multiarch/memset.S b/sysdeps/sparc/sparc64/multiarch/memset.S deleted file mode 100644 index 9469d5e..0000000 --- a/sysdeps/sparc/sparc64/multiarch/memset.S +++ /dev/null @@ -1,124 +0,0 @@ -/* Multiple versions of memset and bzero - All versions must be listed in ifunc-impl-list.c. - Copyright (C) 2010-2017 Free Software Foundation, Inc. - Contributed by David S. Miller (davem@davemloft.net) - 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 - . */ - -#include - -#if IS_IN (libc) - .text -ENTRY(memset) - .type memset, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__memset_niagara4), %o1 - xor %o1, %gdop_lox10(__memset_niagara4), %o1 -# else - set __memset_niagara4, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__memset_niagara1), %o1 - xor %o1, %gdop_lox10(__memset_niagara1), %o1 -# else - set __memset_niagara1, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__memset_ultra1), %o1 - xor %o1, %gdop_lox10(__memset_ultra1), %o1 -# else - set __memset_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(memset) - -ENTRY(__bzero) - .type bzero, @gnu_indirect_function -# ifdef SHARED - SETUP_PIC_REG_LEAF(o3, o5) -# endif - set HWCAP_SPARC_CRYPTO, %o1 - andcc %o0, %o1, %g0 - be 1f - andcc %o0, HWCAP_SPARC_BLKINIT, %g0 -# ifdef SHARED - sethi %gdop_hix22(__bzero_niagara4), %o1 - xor %o1, %gdop_lox10(__bzero_niagara4), %o1 -# else - set __bzero_niagara4, %o1 -# endif - ba 10f - nop -1: be 9f - nop -# ifdef SHARED - sethi %gdop_hix22(__bzero_niagara1), %o1 - xor %o1, %gdop_lox10(__bzero_niagara1), %o1 -# else - set __bzero_niagara1, %o1 -# endif - ba 10f - nop -9: -# ifdef SHARED - sethi %gdop_hix22(__bzero_ultra1), %o1 - xor %o1, %gdop_lox10(__bzero_ultra1), %o1 -# else - set __bzero_ultra1, %o1 -# endif -10: -# ifdef SHARED - add %o3, %o1, %o1 -# endif - retl - mov %o1, %o0 -END(__bzero) - -weak_alias (__bzero, bzero) - -# undef weak_alias -# define weak_alias(a, b) - -libc_hidden_builtin_def (memset) - -#undef libc_hidden_builtin_def -#define libc_hidden_builtin_def(name) - -#define memset __memset_ultra1 -#define __bzero __bzero_ultra1 - -#endif - -#include "../memset.S" diff --git a/sysdeps/sparc/sparc64/multiarch/memset.c b/sysdeps/sparc/sparc64/multiarch/memset.c new file mode 100644 index 0000000..7f1d499 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memset.c @@ -0,0 +1,49 @@ +/* Multiple versions of memset. + All versions must be listed in ifunc-impl-list.c. + Copyright (C) 2017 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 IS_IN (libc) +# define memset __redirect_memset +# define bzero __redirect_bzero +# include +# undef memset +# undef bzero + +# include + +# define SYMBOL_NAME memset +# include "ifunc-memset.h" + +sparc_libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR); + +/* It essentially does libc_hidden_builtin_def (memset) and redirect + the internal symbol to ifunc implementation. */ +# ifdef SHARED +__hidden_ver1 (memset, __GI_memset, __redirect_memset) + __attribute__ ((visibility ("hidden"))); +# endif +# undef SYMBOL_NAME + + +# define SYMBOL_NAME bzero +# include "ifunc-memset.h" + +sparc_libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR); +weak_alias (__bzero, bzero) + +#endif From patchwork Thu Oct 5 13:51:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 114939 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp250742edb; Thu, 5 Oct 2017 06:51:46 -0700 (PDT) X-Received: by 10.99.108.132 with SMTP id h126mr13159585pgc.434.1507211506619; Thu, 05 Oct 2017 06:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507211506; cv=none; d=google.com; s=arc-20160816; b=ManrB1/qoagGvxhD9c67zbyTb1PbTvztQiBQPDyHa9LntDANhRFhh2bODr2Ked08Fj TyXQ1R7wn/Fi6vHUo8jWbjyd4OKL60YZB92AnPeg8Tk08g3lf1B1WsQweREB6KE/MOd7 bJP+dn5CBfh188GamYL08CtfcU56ciql4d+9FKGpVS3sPV8N/krJmOy9wlyGFDzMCpGc KBfVAWdVS8m2EkASouVIs9j4f4g2X5Z94x6hYXqUu8mUyApaX6LlWBm5PQeXIe1JaHIH koKVPal0EHbwaCk3U+HJuFqDqPkZ9M7XOXG7Ro7xq4/O9yAnVZCGs7mMF5zCOqVpD/kr isLA== 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: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=RC/ATDGehJqhCUCrVBY7shiXa5Iqmk3EZz/jcR9TaY8=; b=GHiIq8YGzKwwB0B6Hn4WHGpsuHWAC2i/iXYsXxyvrW4dO5e0hyz0qY64YAVryDBGQp 0p4pIjTKU4Tp/LRFUcQ6/Y9uuJncl0cvWuT9wetv8wmZ+9TKQC0ZAuh/VNkM2o3jws+8 TWOezl04EnxrFt8d95+E1MSq039XWPSO+XZwOP3n673TvHRgUBskXFLNW+oxus5Pj0e2 Ryu2Ig0Ru/r99V+JVXPV+BTeseD+fVyFNyweFfPZv7NcVs12N+b9DKYcevWLYF1enQR1 WyCC22UTEOtxn9nrNbHWSVFbxRhoKo0RRYRxRgoTo0EKTZgR3cCfr8HSgKj9FAb/MzOR AfDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=grV6DG+Q; spf=pass (google.com: domain of libc-alpha-return-85439-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85439-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 bi10si13779862plb.777.2017.10.05.06.51.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 06:51:46 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-85439-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=grV6DG+Q; spf=pass (google.com: domain of libc-alpha-return-85439-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85439-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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=LpebdeWFH+3h5V+jA0eyUcKPvo3Nj5H ZDz10yuAiLLe/hbBgrGFuewQeGHlmrYOjO4+URQp1bXkySE+Rkj0/xUz9dR/qNw7 LxwuBDxkDzmCfU5z4E1WCtTWLt9o55hCKXh1kq0PTVsgJa+HxRcRbuwJWzOxLusO 1QPLYaZabtTs= 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=MpPI5wtsp6O1eNaYSUeLbbmAIFM=; b=grV6D G+QoxSHCdfPjP3XreW3Ms1Ms2Clc56VIebhO6wHrY9AoilaA19l8UpwdouZdXQIJ rTVJCT5KSFEiofyvx2S7811brXswWDXfISTmlFOQOUKoE79rl2Z+ZWGsfVBrCmxj XinDvrRV4ak1GbDJYyxTYWobUhZyh+QcGdAF/4= Received: (qmail 130164 invoked by alias); 5 Oct 2017 13:51:27 -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 129659 invoked by uid 89); 5 Oct 2017 13:51:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f172.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:subject:date:message-id:in-reply-to :references; bh=RC/ATDGehJqhCUCrVBY7shiXa5Iqmk3EZz/jcR9TaY8=; b=UDob7VHfEID1XHxi569jfO3XSf6nqR+ezMfvT9YLfoQyYN1ERgyDaqPl2l6jGoDivn 2NPT9Egd7v1/eCS8T1BaYvWzJz0cMEMpnCuI5AFIu8x23wQDijjxgr1ST5m7Vp78+xvo 7+2cOgxg1agAVJ9xpPVujElqSmXcwScPA/yB0XdsQgVnzHz/0vMRpZcmlvTXYWUT/Yvx GxWT0QbjwGKWnSRoTPz0aXeVgnhaRUa2chUJF5aW8Y8cG6t/c2OEigsKCAmbGv7LH3J/ IrQKcTlBs5zn/U4Ml01Ls1mKsWW5La2Um2g1Y7pyhfRr0Z8eMYLf/J+TZ7S0I7oNcv1R 9z0w== X-Gm-Message-State: AMCzsaX11ACcdTjkrEXSi7KJtI/0F+fIBkfjx6Q4gXhxc0fD2+RCiS1W DPBlNKDkRAub7YpyGrOstBWy5mN4Tis= X-Google-Smtp-Source: AOwi7QCxe+VxSBo/GC8Buo8icfgG+4K5iCkrIWFTftQ7MF6+z2mwU4mWz9d3/dPuPsnrmpK78Y3m/A== X-Received: by 10.55.108.195 with SMTP id h186mr27861772qkc.18.1507211483155; Thu, 05 Oct 2017 06:51:23 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/4] sparc: Use default memcpy for rtld objects Date: Thu, 5 Oct 2017 10:51:11 -0300 Message-Id: <1507211472-1194-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> References: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> Both SPARC support multiarch platforms (sparcv9 and sparc64) have the a default assembly implemented memcpy. Since it should not be any restriction about it them on the loader object and assuming they are faster than generic ones this patch uses them for rtld objects. Also, there is no indication neither on original patch [1] or in commit message why the generic one where used instead of the sparc optimized ones. Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.S: New file. * sysdeps/sparc/sparc64/multiarch/rtld-memcpy.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c: Remove file. * sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c: Likewise. * sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c: Likewise. * sysdeps/sparc/sparc64/rtld-memcpy.c: Likewise. --- ChangeLog | 8 ++++++++ sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.S | 1 + sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c | 1 - sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c | 1 - sysdeps/sparc/sparc64/multiarch/rtld-memcpy.S | 1 + sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c | 1 - sysdeps/sparc/sparc64/rtld-memcpy.c | 3 --- 7 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c delete mode 100644 sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c create mode 100644 sysdeps/sparc/sparc64/multiarch/rtld-memcpy.S delete mode 100644 sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c delete mode 100644 sysdeps/sparc/sparc64/rtld-memcpy.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.S new file mode 100644 index 0000000..8e524da --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.S @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c deleted file mode 100644 index 304ad4e..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memcpy.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c b/sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c deleted file mode 100644 index 6f8386b..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/rtld-memcpy.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-memcpy.S b/sysdeps/sparc/sparc64/multiarch/rtld-memcpy.S new file mode 100644 index 0000000..dc7e095 --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/rtld-memcpy.S @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c b/sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c deleted file mode 100644 index 2452575..0000000 --- a/sysdeps/sparc/sparc64/multiarch/rtld-memcpy.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rtld-memcpy.c" diff --git a/sysdeps/sparc/sparc64/rtld-memcpy.c b/sysdeps/sparc/sparc64/rtld-memcpy.c deleted file mode 100644 index 52f8302..0000000 --- a/sysdeps/sparc/sparc64/rtld-memcpy.c +++ /dev/null @@ -1,3 +0,0 @@ -#define NO_MEMPCPY_STPCPY_REDIRECT -#include -#include From patchwork Thu Oct 5 13:51:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 114942 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp251250edb; Thu, 5 Oct 2017 06:52:19 -0700 (PDT) X-Received: by 10.84.228.193 with SMTP id y1mr13758776pli.301.1507211539561; Thu, 05 Oct 2017 06:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507211539; cv=none; d=google.com; s=arc-20160816; b=engaSNt1VTtt5HubXzdcEoxnQKwsASSElCcF+A6BWUYQsmWVRGRlylqYZDBQ46zGUB ZUTgRZq3Lmwn08wkTrg+b+xdf60w06BrUIOlxpw0vpjbqgwpxJNVxYaq5Yyl/7GzR4OF iz3nDyI9nXMag9VNcjLtqBsI+xehxattsuFm/xouSJoitAJioqlFiX5VQkyEULi/oGCO LMYxnBY8liLfqEpKSk0TM040QKJjdBkPSK5mU+tAOJU9o3g/r7bpdtafQA0T1Oqn9J/H xxyA0MQ8Fv8nJlMJ5nft0NYIbbAZ9m4Lg8SpLiXri39RgpQHkvdqYIZg4quJavFyvy3S Me5w== 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: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=GZCTJq8XWYbeqgM1A5XNdX0ZAKSyNC4FKb5gUWaeyRg=; b=CyuzpsR7GglSm5gmYQXElaarBRtzGuXR2dVsESAqj/n/TT2rmNIeEg6Kj+rq19uwx/ VmQHHKwUck9oHt3KmnOr2DtJhU9RzHjkPB+Ny5eucCE6cKEnxYD5zZM1Ekp4sasaw7ZY dViZSxVAfRq7+9kk82MGWblVArJiGCbWBbUWjjL1xKPdL4lmKjsVLROi0bHkaS23r3Hw F/YOFwXsVZmrkYohtQaBubJywCMyf1Xg+BsOwh66FTDKnjmThhgfgK1XUjACf3gUvc88 OYC5r1qDvDIVdv5lMdW1y8B9g+eh/yKVUgO5MpyrSHHr2iqT9NT0EPlsPUXMyLynOJKR 2GHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=exJqBB2j; spf=pass (google.com: domain of libc-alpha-return-85442-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85442-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 p6si12835757pgq.629.2017.10.05.06.52.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 06:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-85442-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=exJqBB2j; spf=pass (google.com: domain of libc-alpha-return-85442-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-85442-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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Ik5HzIduLTak6L8Wgy/HsHg5ZE9MlOU qhO+sBV70FVUpfMFuj8Ru95aImIKwZy78GkQAz2k9v1UGO0gxd5JYWht1VCZ860N 1Ljyr7NbfcvSzi+KbwV0abOiuI+kEVeOuVvbpZEK2JbjNMCSM+9YWdBz5fJMIO4+ 8kryxTCnbnZA= 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=ZWt1F/J3y78o62wp2T5XOjhLknw=; b=exJqB B2jYS2/ET+WUzqHgA6SGRd+o0Z0ylGvVT38gSLDn5QGPdbreFRZkDxO01ryhZiC2 rbK5ee7eouwNT+TrXxeeWSuggJ3tVifuRAPlfa6HPPVYUC9e5V4ma7Hoxpk138M+ B/slFlLGH5CL3S+hzvkD3eic0hPr/bih26UWHU= Received: (qmail 488 invoked by alias); 5 Oct 2017 13:51:28 -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 130901 invoked by uid 89); 5 Oct 2017 13:51:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f178.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:subject:date:message-id:in-reply-to :references; bh=GZCTJq8XWYbeqgM1A5XNdX0ZAKSyNC4FKb5gUWaeyRg=; b=Yet6yTLKjCFKU7J9+u/kuQ7MCHVYJsH3FE6Wr2hol+C1tQdh88MrKlkHR6NYRwK8Fm fVvUxUKhkE7d+rBZCWY2jzt4sa4XnevMt9mH45/01aJgN2LPD78S1ji5oZXkD2KbtsG1 PqB/shpAaJlW1kcnETobSVn9v+AL+7HLNdvTq0dXgb7vVjnnHNi+tM1PSVSqe6HcbInw 9azH3/boiYMCTHs7YfRMs8NqKWk5nc6JsDLeD7ldqVElOkHp0uvSb+NQZf230HKPzvWx zplv7qXenFLwMZl3iv+KWyFMHN7laIHZBDUsFlrcxe6WmUjfdEaCGxfFvQNm+MFkZNuX 7bfQ== X-Gm-Message-State: AMCzsaV0yHNzPjeb9b32oTJRmcog8r2MNHI74TY7D92haM534xHUvu8w IHC76wQoKOah1QyueroJPc/I6JIqYes= X-Google-Smtp-Source: AOwi7QCDCItrUmL5Yqh7rJq7w0VKW5ew8OTtvORLKOuv3mZtP4eaA98r0TTXoBODqgKHpug+FNH/dA== X-Received: by 10.55.101.81 with SMTP id z78mr79568qkb.161.1507211484611; Thu, 05 Oct 2017 06:51:24 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 4/4] sparc: Use default memset for rtld objects Date: Thu, 5 Oct 2017 10:51:12 -0300 Message-Id: <1507211472-1194-4-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> References: <1507211472-1194-1-git-send-email-adhemerval.zanella@linaro.org> Both SPARC support multiarch platforms (sparcv9 and sparc64) have the a default assembly implemented memset. Since it should not be any restriction about it them on the loader object and assuming they are faster than generic ones this patch uses them for rtld objects. Also, there is no indication neither on original patch [1] or in commit message why the generic one where used instead of the sparc optimized ones. Checked on sparc64-linux-gnu and sparcv9-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.S: New file. * sysdeps/sparc/sparc64/multiarch/rtld-memset.S: New file. * sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c: Remove file. * sysdeps/sparc/sparc32/sparcv9/rtld-memset.c: Likewise. * sysdeps/sparc/sparc64/multiarch/rtld-memset.c: Likewise. * sysdeps/sparc/sparc64/rtld-memset.c: Likewise. --- ChangeLog | 8 ++++++++ sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.S | 1 + sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c | 1 - sysdeps/sparc/sparc32/sparcv9/rtld-memset.c | 1 - sysdeps/sparc/sparc64/multiarch/rtld-memset.S | 1 + sysdeps/sparc/sparc64/multiarch/rtld-memset.c | 1 - sysdeps/sparc/sparc64/rtld-memset.c | 1 - 7 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.S delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c delete mode 100644 sysdeps/sparc/sparc32/sparcv9/rtld-memset.c create mode 100644 sysdeps/sparc/sparc64/multiarch/rtld-memset.S delete mode 100644 sysdeps/sparc/sparc64/multiarch/rtld-memset.c delete mode 100644 sysdeps/sparc/sparc64/rtld-memset.c -- 2.7.4 diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.S new file mode 100644 index 0000000..6e02eeb --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.S @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c deleted file mode 100644 index f24ae88..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memset.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/sparc/sparc32/sparcv9/rtld-memset.c b/sysdeps/sparc/sparc32/sparcv9/rtld-memset.c deleted file mode 100644 index 49b29f5..0000000 --- a/sysdeps/sparc/sparc32/sparcv9/rtld-memset.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-memset.S b/sysdeps/sparc/sparc64/multiarch/rtld-memset.S new file mode 100644 index 0000000..e9f078e --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/rtld-memset.S @@ -0,0 +1 @@ +#include diff --git a/sysdeps/sparc/sparc64/multiarch/rtld-memset.c b/sysdeps/sparc/sparc64/multiarch/rtld-memset.c deleted file mode 100644 index c01eb0b..0000000 --- a/sysdeps/sparc/sparc64/multiarch/rtld-memset.c +++ /dev/null @@ -1 +0,0 @@ -#include "../rtld-memset.c" diff --git a/sysdeps/sparc/sparc64/rtld-memset.c b/sysdeps/sparc/sparc64/rtld-memset.c deleted file mode 100644 index 55f3835..0000000 --- a/sysdeps/sparc/sparc64/rtld-memset.c +++ /dev/null @@ -1 +0,0 @@ -#include