b2e843161d
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
17 lines
308 B
Makefile
17 lines
308 B
Makefile
# $FreeBSD$
|
|
|
|
LDBL_PREC = 113
|
|
|
|
# Use a builtin when it generates the needed instruction
|
|
CFLAGS+=-DUSE_BUILTIN_FMAF
|
|
CFLAGS+=-DUSE_BUILTIN_FMA
|
|
|
|
CFLAGS+=-DUSE_BUILTIN_FMAXF
|
|
CFLAGS+=-DUSE_BUILTIN_FMAX
|
|
|
|
CFLAGS+=-DUSE_BUILTIN_FMINF
|
|
CFLAGS+=-DUSE_BUILTIN_FMIN
|
|
|
|
CFLAGS+=-DUSE_BUILTIN_SQRTF
|
|
CFLAGS+=-DUSE_BUILTIN_SQRT
|