]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use a builtin where possible in msun
authorAndrew Turner <andrew@FreeBSD.org>
Tue, 2 Nov 2021 11:31:17 +0000 (11:31 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Fri, 19 Nov 2021 11:40:46 +0000 (11:40 +0000)
commitb2e843161dc3b79777e873183447c92ed9c3703a
tree00a02aff5ba7560333748626a9fcbb61d69fc342
parent2e8ff4d1d5b9d32b29287efb414449121733544a
Use a builtin where possible in msun

Some of the functions in msun can be implemented using a compiler
builtin function to generate a small number of instructions. Implement
this support in fma, fmax, fmin, and sqrt on arm64.

Care must be taken as the builtin can be implemented as a function
call on some architectures that lack direct support. In these cases
we need to use the original code path.

As we don't set errno on failure build with -fno-math-errno so the
toolchain doesn't convert a builtin into a function call when it
detects a failure, e.g. gcc will add a call to sqrt when the input
is negative leading to an infinite loop.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32801
lib/msun/Makefile
lib/msun/aarch64/Makefile.inc
lib/msun/src/e_sqrt.c
lib/msun/src/e_sqrtf.c
lib/msun/src/s_fma.c
lib/msun/src/s_fmaf.c
lib/msun/src/s_fmax.c
lib/msun/src/s_fmaxf.c
lib/msun/src/s_fmin.c
lib/msun/src/s_fminf.c