llvm-project/compiler-rt/lib/builtins/ppc
Jordan Rupprecht dc48c4fff4 [compiler-rt] [builtins] Add logb/logbf/logbl methods to compiler-rt to avoid libm dependencies when possible.
Summary:
The complex division builtins (div?c3) use logb methods from libm to scale numbers during division and avoid rounding issues. However, these come from libm, meaning anyone that uses --rtlib=compiler-rt also has to include -lm. Implement logb* methods for standard ieee 754 floats so we can avoid -lm on those platforms, falling back to the old behavior (using either logb() or `__builtin_logb()`) when not supported.

These new methods are defined internally as `__compiler_rt_logb` so as not to conflict with the libm definitions in any way.

This fixes just the libm methods mentioned in PR32279 and PR28652. libc is still required, although that seems to not be an issue.

Note: this is proposed as an alternative to just adding -lm: D49330.

Reviewers: efriedma, compnerd, scanon, echristo

Reviewed By: echristo

Subscribers: jsji, echristo, nemanjai, dberris, mgorny, kbarton, delcypher, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D49514

llvm-svn: 342917
2018-09-24 20:39:19 +00:00
..
DD.h Move prototypes for the double-double helpers into the common header. 2015-11-22 18:49:56 +00:00
divtc3.c [compiler-rt] [builtins] Add logb/logbf/logbl methods to compiler-rt to avoid libm dependencies when possible. 2018-09-24 20:39:19 +00:00
fixtfdi.c
fixunstfdi.c
floatditf.c
floatunditf.c
gcc_qadd.c
gcc_qdiv.c
gcc_qmul.c
gcc_qsub.c
multc3.c Move prototypes for the double-double helpers into the common header. 2015-11-22 18:49:56 +00:00
restFP.S builtins: tag with noexecstack 2016-06-22 22:09:42 +00:00
saveFP.S builtins: tag with noexecstack 2016-06-22 22:09:42 +00:00