From patchwork Fri Jul 3 13:38:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 491061 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 0C56F140776 for ; Fri, 3 Jul 2015 23:39:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=sourceware.org header.i=@sourceware.org header.b=XdN6cF8V; 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:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=TJpkiPU/i0UrR/VfuVl7VObVkBlf74S 86Yx9Bv87NTu2kGu8g4tgSsJt5E1jK5I0xy3qIjYDWJ2LaDNU6sF6cBo80KXs+QC ybW579qJ4dw6a2JudpEB7anAXSymzhyIZ2EW5jZdh47hmyJPY99Ibvst9G0TL7Hi mz8zopNRoho8= 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=RIZrZ7Vf8v6TTDt6J83T6Oahmn0=; b=XdN6c F8VKDd2kD9/XTF2vXzs8VRUz2PtodkJBjRA9a5gYI11hA8BCDQYdaggtHxeOuxvI gLC8fbal1Yx3VLKOhag9r19vt4WEX52q51eBUYSXfIHEOs35M7q/fd0cjz2Jc93R cswv1M40QrwlcbKrMdAZ0PymOjq3/1s4C2fAOU= Received: (qmail 94711 invoked by alias); 3 Jul 2015 13:38:53 -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 94677 invoked by uid 89); 3 Jul 2015 13:38:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e06smtp11.uk.ibm.com X-MailFrom: stli@linux.vnet.ibm.com X-RcptTo: libc-alpha@sourceware.org From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH 06/27] S390: Ifunc resolver macro for vector instructions. Date: Fri, 3 Jul 2015 15:38:20 +0200 Message-Id: <1435930721-27922-7-git-send-email-stli@linux.vnet.ibm.com> In-Reply-To: <1435930721-27922-1-git-send-email-stli@linux.vnet.ibm.com> References: <1435930721-27922-1-git-send-email-stli@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070313-0041-0000-0000-000004F9EA8D This patch introduces a s390 specific ifunc resolver macro for 32/64bit, which chooses _vx with vector instructions if HWCAP_S390_VX flag in hwcaps is set or _c if not. ChangeLog: * sysdeps/s390/multiarch/ifunc-resolve.h (s390_vx_libc_ifunc, s390_vx_libc_ifunc2): New macro function. --- sysdeps/s390/multiarch/ifunc-resolve.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h index 491df68..e9fd90e 100644 --- a/sysdeps/s390/multiarch/ifunc-resolve.h +++ b/sysdeps/s390/multiarch/ifunc-resolve.h @@ -73,3 +73,22 @@ else \ return &__##FUNC##_default; \ } + +#define s390_vx_libc_ifunc(FUNC) \ + s390_vx_libc_ifunc2(FUNC, FUNC) + +#define s390_vx_libc_ifunc2(RESOLVERFUNC, FUNC) \ + /* Make the declarations of the optimized functions hidden in order + to prevent GOT slots being generated for them. */ \ + extern __typeof (FUNC) RESOLVERFUNC##_vx attribute_hidden; \ + extern __typeof (FUNC) RESOLVERFUNC##_c attribute_hidden; \ + extern void *__resolve_##RESOLVERFUNC (unsigned long int) __asm__ (#FUNC); \ + \ + void *__resolve_##RESOLVERFUNC (unsigned long int dl_hwcap) \ + { \ + if (dl_hwcap & HWCAP_S390_VX) \ + return &RESOLVERFUNC##_vx; \ + else \ + return &RESOLVERFUNC##_c; \ + } \ + __asm__ (".type " #FUNC ", %gnu_indirect_function");