New symbol version for logf, log2f and powf without SVID compat

This patch changes the logf, log2f and powf error handling semantics
to only set errno accoring to POSIX rules. New symbol version is
introduced at GLIBC_2.27.

The old wrappers are kept for compat symbols.

ia64 needed assembly change to have the new and compat versioned
symbol map to the same function.

All linux libm abilists are updated.

	* math/Versions (logf): New libm symbol at GLIBC_2.27.
	(log2f): Likewise.
	(powf): Likewise.
	* math/w_log2f.c: New file.
	* math/w_logf.c: New file.
	* math/w_powf.c: New file.
	* math/w_log2f_compat.c (__log2f_compat): For compat symbol only.
	* math/w_logf_compat.c (__logf_compat): Likewise.
	* math/w_powf_compat.c (__powf_compat): Likewise.
	* sysdeps/ia64/fpu/e_log2f.S: Add versioned symbols.
	* sysdeps/ia64/fpu/e_logf.S: Likewise.
	* sysdeps/ia64/fpu/e_powf.S: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
This commit is contained in:
Szabolcs Nagy 2017-09-13 17:19:51 +01:00
parent 59ba2d2b54
commit 72d3d28108
37 changed files with 178 additions and 14 deletions

View File

@ -1,3 +1,50 @@
2017-10-02 Szabolcs Nagy <szabolcs.nagy@arm.com>
* math/Versions (logf): New libm symbol at GLIBC_2.27.
(log2f): Likewise.
(powf): Likewise.
* math/w_log2f.c: New file.
* math/w_logf.c: New file.
* math/w_powf.c: New file.
* math/w_log2f_compat.c (__log2f_compat): For compat symbol only.
* math/w_logf_compat.c (__logf_compat): Likewise.
* math/w_powf_compat.c (__powf_compat): Likewise.
* sysdeps/ia64/fpu/e_log2f.S: Add versioned symbols.
* sysdeps/ia64/fpu/e_logf.S: Likewise.
* sysdeps/ia64/fpu/e_powf.S: Likewise.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2017-10-02 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
* sysdeps/powerpc/powerpc64/multiarch/Makefile

View File

@ -230,6 +230,6 @@ libm {
fromfpx; fromfpxf; fromfpxl; ufromfpx; ufromfpxf; ufromfpxl;
}
GLIBC_2.27 {
expf; exp2f;
expf; exp2f; logf; log2f; powf;
}
}

7
math/w_log2f.c Normal file
View File

@ -0,0 +1,7 @@
#include <math-type-macros-float.h>
#undef __USE_WRAPPER_TEMPLATE
#define __USE_WRAPPER_TEMPLATE 1
#undef declare_mgen_alias
#define declare_mgen_alias(a, b)
#include <w_log2_template.c>
versioned_symbol (libm, __log2f, log2f, GLIBC_2_27);

View File

@ -23,10 +23,10 @@
#include <libm-alias-float.h>
#if LIBM_SVID_COMPAT
#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)
/* wrapper log2f(x) */
float
__log2f (float x)
__log2f_compat (float x)
{
if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
{
@ -44,5 +44,5 @@ __log2f (float x)
return __ieee754_log2f (x);
}
libm_alias_float (__log2, log2)
compat_symbol (libm, __log2f_compat, log2f, GLIBC_2_1);
#endif

7
math/w_logf.c Normal file
View File

@ -0,0 +1,7 @@
#include <math-type-macros-float.h>
#undef __USE_WRAPPER_TEMPLATE
#define __USE_WRAPPER_TEMPLATE 1
#undef declare_mgen_alias
#define declare_mgen_alias(a, b)
#include <w_log_template.c>
versioned_symbol (libm, __logf, logf, GLIBC_2_27);

View File

@ -23,10 +23,10 @@
#include <libm-alias-float.h>
#if LIBM_SVID_COMPAT
#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
/* wrapper logf(x) */
float
__logf (float x)
__logf_compat (float x)
{
if (__builtin_expect (islessequal (x, 0.0f), 0) && _LIB_VERSION != _IEEE_)
{
@ -44,5 +44,5 @@ __logf (float x)
return __ieee754_logf (x);
}
libm_alias_float (__log, log)
compat_symbol (libm, __logf_compat, logf, GLIBC_2_0);
#endif

7
math/w_powf.c Normal file
View File

@ -0,0 +1,7 @@
#include <math-type-macros-float.h>
#undef __USE_WRAPPER_TEMPLATE
#define __USE_WRAPPER_TEMPLATE 1
#undef declare_mgen_alias
#define declare_mgen_alias(a, b)
#include <w_pow_template.c>
versioned_symbol (libm, __powf, powf, GLIBC_2_27);

View File

@ -22,10 +22,10 @@
#include <libm-alias-float.h>
#if LIBM_SVID_COMPAT
#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
/* wrapper powf */
float
__powf (float x, float y)
__powf_compat (float x, float y)
{
float z = __ieee754_powf (x, y);
if (__glibc_unlikely (!isfinite (z)))
@ -60,5 +60,5 @@ __powf (float x, float y)
return z;
}
libm_alias_float (__pow, pow)
compat_symbol (libm, __powf_compat, powf, GLIBC_2_0);
#endif

View File

@ -252,7 +252,7 @@ LOCAL_OBJECT_END(T_table)
.section .text
GLOBAL_LIBM_ENTRY(log2f)
GLOBAL_LIBM_ENTRY(__log2f)
{ .mfi
alloc r32=ar.pfs,1,4,4,0
@ -491,7 +491,13 @@ SPECIAL_log2f:
br.ret.sptk b0;;
}
GLOBAL_LIBM_END(log2f)
GLOBAL_LIBM_END(__log2f)
#ifdef SHARED
.symver __log2f,log2f@@GLIBC_2.27
.weak __log2f_compat
.set __log2f_compat,__log2f
.symver __log2f_compat,log2f@GLIBC_2.2
#endif
LOCAL_LIBM_ENTRY(__libm_error_region)

View File

@ -1088,6 +1088,12 @@ logf_libm_err:
nop.i 0
};;
GLOBAL_IEEE754_END(logf)
#ifdef SHARED
.symver logf,logf@@GLIBC_2.27
.weak __logf_compat
.set __logf_compat,__logf
.symver __logf_compat,logf@GLIBC_2.2
#endif
// Stack operations when calling error support.

View File

@ -868,7 +868,7 @@ data8 0xEAC0C6E7DD24392F , 0x00003FFF
LOCAL_OBJECT_END(pow_tbl2)
.section .text
GLOBAL_LIBM_ENTRY(powf)
GLOBAL_LIBM_ENTRY(__powf)
// Get exponent of x. Will be used to calculate K.
{ .mfi
@ -2002,7 +2002,13 @@ POW_OVER_UNDER_ERROR:
}
;;
GLOBAL_LIBM_END(powf)
GLOBAL_LIBM_END(__powf)
#ifdef SHARED
.symver __powf,powf@@GLIBC_2.27
.weak __powf_compat
.set __powf_compat,__powf
.symver __powf_compat,powf@GLIBC_2.2
#endif
LOCAL_LIBM_ENTRY(__libm_error_region)

View File

@ -463,3 +463,6 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -473,6 +473,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.3.4 GLIBC_2.3.4 A
GLIBC_2.3.4 __c1_cabsf F
GLIBC_2.3.4 __c1_cacosf F

View File

@ -120,6 +120,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F

View File

@ -432,5 +432,8 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F

View File

@ -614,4 +614,7 @@ GLIBC_2.26 ynf128 F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -543,4 +543,7 @@ GLIBC_2.26 ynf128 F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -120,6 +120,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 _LIB_VERSION D 0x4
GLIBC_2.4 __clog10 F

View File

@ -474,4 +474,7 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -431,3 +431,6 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -433,6 +433,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F
_gp_disp _gp_disp A

View File

@ -465,4 +465,7 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -431,3 +431,6 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -476,6 +476,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -475,6 +475,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -608,3 +608,6 @@ GLIBC_2.26 ynf128 F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -151,6 +151,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.3 GLIBC_2.3 A
GLIBC_2.3 _LIB_VERSION D 0x4
GLIBC_2.3 __clog10 F

View File

@ -463,6 +463,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -461,6 +461,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -432,5 +432,8 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 exp2l F

View File

@ -467,6 +467,9 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A
GLIBC_2.4 __clog10l F
GLIBC_2.4 __finitel F

View File

@ -464,4 +464,7 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -432,3 +432,6 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -432,3 +432,6 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -432,3 +432,6 @@ GLIBC_2.25 ufromfpxl F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F

View File

@ -603,4 +603,7 @@ GLIBC_2.26 ynf128 F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F
GLIBC_2.4 GLIBC_2.4 A

View File

@ -602,3 +602,6 @@ GLIBC_2.26 ynf128 F
GLIBC_2.27 GLIBC_2.27 A
GLIBC_2.27 exp2f F
GLIBC_2.27 expf F
GLIBC_2.27 log2f F
GLIBC_2.27 logf F
GLIBC_2.27 powf F