From patchwork Fri Jun 26 11:51:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 7362 Received: (qmail 20558 invoked by alias); 26 Jun 2015 11:52:06 -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 20328 invoked by uid 89); 26 Jun 2015 11:52:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp10.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, 26 Jun 2015 13:51:31 +0200 Message-Id: <1435319512-22245-7-git-send-email-stli@linux.vnet.ibm.com> In-Reply-To: <1435319512-22245-1-git-send-email-stli@linux.vnet.ibm.com> References: <1435319512-22245-1-git-send-email-stli@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15062611-0041-0000-0000-000004BCB3CC 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");