From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23035 invoked by alias); 24 Jun 2013 17:07:50 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 22988 invoked by uid 89); 24 Jun 2013 17:07:44 -0000 X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-qe0-f52.google.com (HELO mail-qe0-f52.google.com) (209.85.128.52) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 24 Jun 2013 17:07:43 +0000 Received: by mail-qe0-f52.google.com with SMTP id i11so338961qej.25 for ; Mon, 24 Jun 2013 10:07:41 -0700 (PDT) X-Received: by 10.224.168.14 with SMTP id s14mr27619499qay.91.1372093661153; Mon, 24 Jun 2013 10:07:41 -0700 (PDT) Received: from anchor.com (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id ff5sm20942217qeb.6.2013.06.24.10.07.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 10:07:40 -0700 (PDT) From: Richard Henderson To: libc-ports@sourceware.org Cc: roland@hack.frob.com, joseph@codesourcery.com Subject: [RFC] BZ 15666: alpha: Add __sqrt*_finite definitions Date: Mon, 24 Jun 2013 17:07:00 -0000 Message-Id: <1372093627-26874-1-git-send-email-rth@twiddle.net> X-SW-Source: 2013-06/txt/msg00044.txt.bz2 With compatibility for ev6 and non-ev6 builds, as the non-ev6 did manage to get definitions emitted for the float and double functions. This doesn't quite work. The __sqrtl_finite version gets emitted to the wrong version. I had thought that adding symbols to the Versions file at a later version would override earlier symbols in the more generic Versions file, but it appears that isn't so? Must I solve this with an explicit versioned_symbol macro, or is there a better way? r~ * sysdeps/alpha/Versions (GLIBC_2.18): Add __sqrt_finite, __sqrtf_finite, and __sqrtl_finite. * sysdeps/alpha/alphaev6/fpu/e_sqrt.S: Add __sqrt_finite. * sysdeps/alpha/alphaev6/fpu/e_sqrtf.S: Add __sqrtf_finite. * sysdeps/alpha/fpu/e_sqrt.c: Add __sqrt_finite compatibility. * sysdeps/alpha/fpu/e_sqrtf.c: New file. * sysdeps/alpha/soft-fp/e_sqrtl.c: Add __sqrtl_finite. --- ports/sysdeps/alpha/Versions | 4 ++++ ports/sysdeps/alpha/alphaev6/fpu/e_sqrt.S | 9 +++++++++ ports/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S | 9 +++++++++ ports/sysdeps/alpha/fpu/e_sqrt.c | 22 ++++++++++++++++++++++ ports/sysdeps/alpha/fpu/e_sqrtf.c | 14 ++++++++++++++ ports/sysdeps/alpha/soft-fp/e_sqrtl.c | 2 ++ 6 files changed, 60 insertions(+) create mode 100644 ports/sysdeps/alpha/fpu/e_sqrtf.c diff --git a/ports/sysdeps/alpha/Versions b/ports/sysdeps/alpha/Versions index 76b67a6..ae8fde7 100644 --- a/ports/sysdeps/alpha/Versions +++ b/ports/sysdeps/alpha/Versions @@ -10,4 +10,8 @@ libm { # used in inline functions. __atan2; } + GLIBC_2.18 { + # forgotten when the symbols were added to glibc 2.15 for other targets + __sqrt_finite; __sqrtf_finite; __sqrtl_finite; + } } diff --git a/ports/sysdeps/alpha/alphaev6/fpu/e_sqrt.S b/ports/sysdeps/alpha/alphaev6/fpu/e_sqrt.S index 66be65e..2aac3d3 100644 --- a/ports/sysdeps/alpha/alphaev6/fpu/e_sqrt.S +++ b/ports/sysdeps/alpha/alphaev6/fpu/e_sqrt.S @@ -16,6 +16,7 @@ . */ #include +#include .arch ev6 .set noreorder @@ -42,3 +43,11 @@ ENTRY(__ieee754_sqrt) nop END(__ieee754_sqrt) + +#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +strong_alias(__ieee754_sqrt, __sqrt_finite1) +compat_symbol(libm, __sqrt_finite1, __sqrt_finite, GLIBC_2_15) +versioned_symbol(libm, __ieee754_sqrt, __sqrt_finite, GLIBC_2_18) +#else +strong_alias(__ieee754_sqrt, __sqrt_finite) +#endif diff --git a/ports/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S b/ports/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S index ad89786..5aeafca 100644 --- a/ports/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S +++ b/ports/sysdeps/alpha/alphaev6/fpu/e_sqrtf.S @@ -16,6 +16,7 @@ . */ #include +#include .arch ev6 .set noreorder @@ -42,3 +43,11 @@ ENTRY(__ieee754_sqrtf) nop END(__ieee754_sqrtf) + +#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +strong_alias(__ieee754_sqrtf, __sqrtf_finite1) +compat_symbol(libm, __sqrtf_finite1, __sqrtf_finite, GLIBC_2_15) +versioned_symbol(libm, __ieee754_sqrtf, __sqrtf_finite, GLIBC_2_18) +#else +strong_alias(__ieee754_sqrtf, __sqrtf_finite) +#endif diff --git a/ports/sysdeps/alpha/fpu/e_sqrt.c b/ports/sysdeps/alpha/fpu/e_sqrt.c index 538ff1d..6abca08 100644 --- a/ports/sysdeps/alpha/fpu/e_sqrt.c +++ b/ports/sysdeps/alpha/fpu/e_sqrt.c @@ -18,6 +18,7 @@ #include #include +#include #if !defined(_IEEE_FP_INEXACT) @@ -157,9 +158,30 @@ $fixup: \n\ \n\ .end __ieee754_sqrt"); +/* Avoid the __sqrt_finite alias that dbl-64/e_sqrt.c would give... */ +#undef strong_alias +#define strong_alias(a,b) + +/* ... defining our own. */ +#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +asm (".global __sqrt_finite1; __sqrt_finite1 = __ieee754_sqrt"); +#else +asm (".global __sqrt_finite; __sqrt_finite = __ieee754_sqrt"); +#endif + static double __full_ieee754_sqrt(double) __attribute_used__; #define __ieee754_sqrt __full_ieee754_sqrt +#elif SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +# define __sqrt_finite __sqrt_finite1 #endif /* _IEEE_FP_INEXACT */ #include + +/* Work around forgotten symbol in alphaev6 build. */ +#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +# undef __sqrt_finite +# undef __ieee754_sqrt +compat_symbol (libm, __sqrt_finite1, __sqrt_finite, GLIBC_2_15); +versioned_symbol (libm, __ieee754_sqrt, __sqrt_finite, GLIBC_2_18); +#endif diff --git a/ports/sysdeps/alpha/fpu/e_sqrtf.c b/ports/sysdeps/alpha/fpu/e_sqrtf.c new file mode 100644 index 0000000..ad523f5 --- /dev/null +++ b/ports/sysdeps/alpha/fpu/e_sqrtf.c @@ -0,0 +1,14 @@ +#include + +#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +# define __sqrtf_finite __sqrtf_finite1 +#endif + +#include + +/* Work around forgotten symbol in alphaev6 build. */ +#if SHLIB_COMPAT (libm, GLIBC_2_15, GLIBC_2_18) +# undef __sqrtf_finite +compat_symbol (libm, __sqrtf_finite1, __sqrtf_finite, GLIBC_2_15); +versioned_symbol (libm, __ieee754_sqrtf, __sqrtf_finite, GLIBC_2_18); +#endif diff --git a/ports/sysdeps/alpha/soft-fp/e_sqrtl.c b/ports/sysdeps/alpha/soft-fp/e_sqrtl.c index 40e97b8..2dc152f 100644 --- a/ports/sysdeps/alpha/soft-fp/e_sqrtl.c +++ b/ports/sysdeps/alpha/soft-fp/e_sqrtl.c @@ -37,3 +37,5 @@ __ieee754_sqrtl (const long double a) FP_HANDLE_EXCEPTIONS; return c; } + +strong_alias(__ieee754_sqrtl, __sqrtl_finite) -- 1.8.1.4