[PATCH v2 06/14] LoongArch: Generic <math.h> and soft-fp Routines
Joseph Myers
joseph@codesourcery.com
Tue Jan 4 20:31:42 GMT 2022
On Tue, 4 Jan 2022, Adhemerval Zanella via Libc-alpha wrote:
> This is being replicated already on aarch64 and mips64, maybe we could
> add on a generic folder and use it instead.
We have sysdeps/ieee754/soft-fp/ for something similar, but that's only
intended to be used via Implies in cases where software floating point
with no exceptions / rounding modes support is in use and so the generic
round-to-odd function implementations would be incorrect.
However, particular functions in that directory can be used via #include
from elsewhere in sysdeps if appropriate - whether because of the lack of
another generic implementation to use (as in the case of ldbl-128 sqrtl)
or because it's more efficient (see how sysdeps/mips/ieee754/s_fmal.c
includes sysdeps/ieee754/soft-fp/s_fmal.c because long double is always
implemented in software for MIPS64). So you could add sqrtl to that
directory then #include it from individual architectures. Or you could
have e.g. ldbl-128-soft-fp that can go in sysdeps when appropriate, with
the option to use it also for cases like MIPS fmal where the soft-fp
implementation is more efficient than using the ldbl-128 version when all
the underlying arithmetic operations used are themselves soft-fp
operations.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list