HomeFreeBSD

riscv: Add a soft-float implementation of fabs()

Description

riscv: Add a soft-float implementation of fabs()

We could just use a C implementation using __builtin_fabs(), but using
this assembly version guarantees that there is no additional prolog/epilog
code. Additionally, clang generates worse code for masking off the top bit
than GCC: https://bugs.llvm.org/show_bug.cgi?id=49377.

This fixes the RISCV64 softfloat world build after cf97d2a1dab8. That commit
added -fno-builtin to the msun tests which resulted in the first references to
fabs (previously the compiler inlined all calls).

Reviewed By: dim
Reported by: mjg
Differential Revision: https://reviews.freebsd.org/D28994

Details

Provenance
arichardsonAuthored on Mar 1 2021, 12:46 PM
Reviewer
dim
Differential Revision
D28994: riscv: Add a soft-float implementation of fabs()
Parents
rGa26ace4db6d9: tools/build/make.py: Don't call brew --prefix if --cross-bindir is set
Branches
Unknown
Tags
Unknown