glibc/sysdeps/sparc/sparc32
Joseph Myers 831bbd5527 Remove SPARC sqrt wrappers (bug 21973).
This patch removes the SPARC-specific wrappers for sqrt and sqrtf.

These wrappers, by adding architecture-specific uses of _LIB_VERSION
and __kernel_standard, unnecessarily complicate cleanups of libm error
handling.  They also do not serve a useful optimization purpose.  GCC
knows about sqrt as a built-in function, and can generate direct calls
to a hardware square root instruction, either on its own, in the
-fno-math-errno case, or together with an inline check for the
argument being negative and a call to the out-of-line sqrt function
for error handling only in that case (and has been able to do so for a
long time).  Thus in practice the wrapper will only be called only in
the case of negative arguments, which is not a case it is useful to
optimize for.

The removal of the wrappers also uncovers, and fixes, an old bug.
32-bit SPARC libm used (checked with glibc 2.8 binaries) to have a
sqrtl compat symbol, version GLIBC_2.0, for old binaries when sqrtl
was an alias of sqrt (I don't have pre-glibc-2.4 binaries for SPARC to
hand to check for the sqrtl symbol in those).  This disappeared,
probably with:

commit 8847f03770
Author: David S. Miller <davem@davemloft.net>
Date:   Tue Feb 28 22:37:58 2012 -0800

    Add sparc optimized sqrt{,f}.

Removing the wrappers brings back the generic ldbl-opt logic for
creating such compat symbols, and so restores the compat symbol that
should be there.  This could of course also be fixed in the wrappers -
but as noted above, the wrappers are optimizing a case it's not useful
to optimize, so the bug of the missing compat symbol serves to
illustrate the risks involved with the extra complexity of
architecture-specific function versions where not needed.

Tested with build-many-glibcs.py.

	[BZ #21973]
	* sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S: Remove file.
	* sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S : Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add
	GLIBC_2.0 sqrtl symbol.
2017-08-21 17:46:34 +00:00
..
bits
fpu Remove SPARC sqrt wrappers (bug 21973). 2017-08-21 17:46:34 +00:00
soft-fp
sparcv8
sparcv9 Remove SPARC sqrt wrappers (bug 21973). 2017-08-21 17:46:34 +00:00
__longjmp.S
add_n.S
addmul_1.S
alloca.S
atomic-machine.h Optimize generic spinlock code and use C11 like atomic macros. 2017-06-06 09:41:56 +02:00
backtrace.h
bsd-_setjmp.S
bsd-setjmp.S
bzero.c
divrem.m4
dl-irel.h
dl-machine.h PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
dl-plt.h
dl-trampoline.S
dotmul.S
e_sqrt.c
ieee754.h
Implies
jmpbuf-offsets.h
jmpbuf-unwind.h
lll_timedlock_wait.c
lll_timedwait_tid.c
lowlevellock.c
lshift.S
Makefile
memchr.S
memcpy.S
memset.S
mul_1.S
pthread_barrier_wait.c
pthread_spin_lock.S
pthread_spin_trylock.S
pthreaddef.h
rem.S
rshift.S
sdiv.S
sem_post.c
sem_waitcommon.c
setjmp.S
stackguard-macros.h
start.S
stpcpy.S
strcat.S
strchr.S
strcmp.S
strcpy.S
strlen.S
strrchr.c
sub_n.S
submul_1.S
tls-macros.h
tst-audit.h
udiv.S
umul.S
urem.S
Versions