From patchwork Fri Nov 30 15:58:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1006073 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-97799-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="PO6VhyVR"; dkim-atps=neutral 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 43605c07zTz9s8r for ; Sat, 1 Dec 2018 03:21:55 +1100 (AEDT) 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:in-reply-to:references :message-id; q=dns; s=default; b=ZMWkEm3PeAokLhnl5/uc7CBG8LPFNza YTeEDyJf7kZGoP7qZXyv+GutJVbcmyBDMEjWBgeEhMBlzXOOOzCx+rd39jBYOmH0 nH5CxdUsH4YIvXZufdOLYfBALRFDzWOf7MALP7d5/OYnGaUKK8Byv8PzUgWzZcCc PSEztRaEcPps= 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:in-reply-to:references :message-id; s=default; bh=YdYTlox0xhS3P/pdAr/FvZogZaI=; b=PO6Vh yVRa/WXnsh8rrcMIjMypqP9XI+HQhBzcm8dTrfLWV+8SvphtMCisRm4ct54n5ezU KlH3TJ4gwUnYLu6JEJvrWqxYOwc0lE6L2VaUCKBqI9Zhsd2/IC0r+r0b+nz81bLe BMzaGCjtBiCdU6eZQYmZI+2W4td83H0MeTt0kQ= Received: (qmail 44358 invoked by alias); 30 Nov 2018 16:21:50 -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 44342 invoked by uid 89); 30 Nov 2018 16:21:49 -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= X-HELO: mx0a-001b2d01.pphosted.com From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH 55/56] S390: Refactor gconv_simple ifunc handling. Date: Fri, 30 Nov 2018 16:58:33 +0100 In-Reply-To: <1543593514-10251-1-git-send-email-stli@linux.ibm.com> References: <1543593514-10251-1-git-send-email-stli@linux.ibm.com> x-cbid: 18113016-0012-0000-0000-000002D2B629 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18113016-0013-0000-0000-00002108047E Message-Id: <1543593514-10251-56-git-send-email-stli@linux.ibm.com> The ifunc handling for various __gconv_transform_* functions which are using IFUNC on s390x are adjusted in order to omit ifunc if the minimum architecture level already supports newer CPUs by default. Instead those functions are just an alias to the vector variants. Furthermore the ifunc-macro s390_libc_ifunc_expr is now used instead of s390_vx_libc_ifunc. ChangeLog: * sysdeps/s390/multiarch/gconv_simple.c (ICONV_VX_IFUNC): Define macro dependent on HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT. --- sysdeps/s390/multiarch/gconv_simple.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sysdeps/s390/multiarch/gconv_simple.c b/sysdeps/s390/multiarch/gconv_simple.c index aaa1ebf74a..078d992c13 100644 --- a/sysdeps/s390/multiarch/gconv_simple.c +++ b/sysdeps/s390/multiarch/gconv_simple.c @@ -27,17 +27,18 @@ # define ICONV_C_NAME(NAME) __##NAME##_c # define ICONV_VX_NAME(NAME) __##NAME##_vx -# define ICONV_VX_IFUNC(FUNC) \ - extern __typeof (ICONV_C_NAME (FUNC)) __##FUNC; \ - s390_vx_libc_ifunc (__##FUNC) \ - int FUNC (struct __gconv_step *step, struct __gconv_step_data *data, \ - const unsigned char **inptrp, const unsigned char *inend, \ - unsigned char **outbufstart, size_t *irreversible, \ - int do_flush, int consume_incomplete) \ - { \ - return __##FUNC (step, data, inptrp, inend,outbufstart, \ - irreversible, do_flush, consume_incomplete); \ - } +# ifdef HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT +/* We support z13 instructions by default -> Just use the vector variant. */ +# define ICONV_VX_IFUNC(FUNC) strong_alias (ICONV_VX_NAME (FUNC), FUNC) +# else +/* We have to use ifunc to determine if z13 instructions are supported. */ +# define ICONV_VX_IFUNC(FUNC) \ + s390_libc_ifunc_expr (ICONV_C_NAME (FUNC), FUNC, \ + (hwcap & HWCAP_S390_VX) \ + ? ICONV_VX_NAME (FUNC) \ + : ICONV_C_NAME (FUNC) \ + ) +# endif # define ICONV_VX_SINGLE(NAME) \ static __typeof (NAME##_single) __##NAME##_vx_single __attribute__((alias(#NAME "_single")));