From patchwork Mon Dec 3 08:20:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 30524 Received: (qmail 100898 invoked by alias); 3 Dec 2018 08:20:46 -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 100888 invoked by uid 89); 3 Dec 2018 08:20:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=ifunc X-HELO: mx0a-001b2d01.pphosted.com Subject: Re: [PATCH 02/56] S390: Use hwcap instead of dl_hwcap in ifunc-resolvers. To: Florian Weimer Cc: libc-alpha@sourceware.org References: <1543593514-10251-1-git-send-email-stli@linux.ibm.com> <1543593514-10251-3-git-send-email-stli@linux.ibm.com> <87va4eqxgb.fsf@oldenburg.str.redhat.com> From: Stefan Liebler Date: Mon, 3 Dec 2018 09:20:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <87va4eqxgb.fsf@oldenburg.str.redhat.com> x-cbid: 18120308-0008-0000-0000-0000029C049A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120308-0009-0000-0000-000022065BFF Message-Id: <8510bbfc-ba54-d16e-405e-5e1e692b2696@linux.ibm.com> On 11/30/2018 06:36 PM, Florian Weimer wrote: > * Stefan Liebler: > >> + if (__glibc_likely((hwcap & HWCAP_S390_STFLE) \ > > Missing space before paren. Since HWCAP_S390_STFLE 4 is four, this > __glibc_likely is actually equivalent to __glibc_unlikely, so perhaps > you should drop it. > > Thanks, > Florian > Hi Florian, I've added the missing space. The condition of __glibc_likely does not result in the value "4" as the full condition is: (hwcap & HWCAP_S390_STFLE) && (hwcap & HWCAP_S390_ZARCH) && (hwcap & HWCAP_S390_HIGH_GPRS) If hwcap is e.g. 518, then the result is one and __glibc_likely is not equivalent to __glibc_unlikely. Note: here are the other HWCAP_S390 defines: #define HWCAP_S390_STFLE 4 #define HWCAP_S390_ZARCH 2 #define HWCAP_S390_HIGH_GPRS 512 Thanks. Stefan From faeb0c30779296d58baab460e4671bc5e60d2609 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Fri, 30 Nov 2018 15:42:58 +0100 Subject: [PATCH 02/56] S390: Use hwcap instead of dl_hwcap in ifunc-resolvers. The renaming of hwcap arguments in ifunc-resolvers is needed in order to prepare for further commits which refactors ifunc handling for memset, memcmp, and memcpy. Now you are able to use s390_libc_ifunc_init which stores the stfle bits within the expression for an ifunc-resolver generated by s390_libc_ifunc_expr. ChangeLog: * sysdeps/s390/multiarch/ifunc-resolve.h (s390_libc_ifunc_init, s390_libc_ifunc, s390_vx_libc_ifunc2_redirected): Use hwcap instead of dl_hwcap. --- sysdeps/s390/multiarch/ifunc-resolve.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h index b42ed922fd..b7e20abc59 100644 --- a/sysdeps/s390/multiarch/ifunc-resolve.h +++ b/sysdeps/s390/multiarch/ifunc-resolve.h @@ -42,9 +42,9 @@ : : "cc"); #define s390_libc_ifunc_init() \ unsigned long long stfle_bits = 0ULL; \ - if (__glibc_likely((dl_hwcap & HWCAP_S390_STFLE) \ - && (dl_hwcap & HWCAP_S390_ZARCH) \ - && (dl_hwcap & HWCAP_S390_HIGH_GPRS))) \ + if (__glibc_likely ((hwcap & HWCAP_S390_STFLE) \ + && (hwcap & HWCAP_S390_ZARCH) \ + && (hwcap & HWCAP_S390_HIGH_GPRS))) \ { \ S390_STORE_STFLE (stfle_bits); \ } @@ -61,7 +61,7 @@ : __glibc_likely (S390_IS_Z10 (stfle_bits)) \ ? RESOLVERFUNC##_z10 \ : RESOLVERFUNC##_default, \ - unsigned long int dl_hwcap, s390_libc_ifunc_init); + unsigned long int hwcap, s390_libc_ifunc_init); #define s390_vx_libc_ifunc(FUNC) \ s390_vx_libc_ifunc2_redirected(FUNC, FUNC, FUNC) @@ -79,10 +79,10 @@ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_vx attribute_hidden; \ extern __typeof (TYPE_FUNC) RESOLVERFUNC##_c attribute_hidden; \ __ifunc (TYPE_FUNC, FUNC, \ - (dl_hwcap & HWCAP_S390_VX) \ + (hwcap & HWCAP_S390_VX) \ ? RESOLVERFUNC##_vx \ : RESOLVERFUNC##_c, \ - unsigned long int dl_hwcap, s390_vx_libc_ifunc_init); + unsigned long int hwcap, s390_vx_libc_ifunc_init); #define s390_libc_ifunc_expr_init() #define s390_libc_ifunc_expr(TYPE_FUNC, FUNC, EXPR) \ -- 2.17.0