[llvm-dev] RFC: Constant folding math functions for long double

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 4 07:06:18 PDT 2016

On 4 April 2016 at 14:59, James Molloy via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>   1. Introduce a dependency on libMPFR, as GCC does. The dependency could be
> hard or soft, with a fallback to the current behaviour if it doesn't exist.

A soft dependency would be much better.

>   3. If the long double format on the compiler host is the same as the
> target, use the host library.

No hard feelings about this one...

> (2) is the hardest. (3) is the easiest, but only works in a subset of cases
> and I really don't like the idea of better output when compiling on one
> platform compared to another (with equivalent targets).

If you make (1) a soft dependency, then (3) will have the same effect,
ie, sometimes the code will be better, sometimes it won't.

I personally don't feel bad about introducing soft dependencies or
special cases to make code better, as long as the users understand how
to make their code better if they wish (ie. documenting the
dependency). So I think both (1) and (3) are acceptable solutions,
when properly documented.


More information about the llvm-dev mailing list