abs(long long)

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Oct 2 16:45:00 GMT 2012


On Tue, Oct 2, 2012 at 8:07 AM, Marc Glisse <marc.glisse@inria.fr> wrote:

> Or do you mean:
> always call __builtin_llabs (whether we have an llabs or not), and let the
> compiler replace it with either (x<0)?-x:x or a library call (I assume it
> never does that unless it has seen a corresponding declaration)?

See what we did in c/cmath and c_global/cmath.
What you find there is the result of years of several iterations
(including something similar to your earlier patch) all having issues
in one way of another until we settled on the builtin functions approach.
I have no appetite to go back to those days full of headache.

-- Gaby



More information about the Libstdc++ mailing list