poor codegen for abs(), and div by literal?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Feb 8 00:36:33 UTC 2019


On Fri, Feb 08, 2019 at 12:09:55AM +0000, kinke via Digitalmars-d wrote:
[...]
> Or just open std.math to see the simple reason for the old FPU being
> used:
> 
> ```
> real fabs(real x) @safe pure nothrow @nogc { pragma(inline, true);
> return core.math.fabs(x); }
> //FIXME
> ///ditto
> double fabs(double x) @safe pure nothrow @nogc { return fabs(cast(real) x);
> }
> //FIXME
> ///ditto
> float fabs(float x) @safe pure nothrow @nogc { return fabs(cast(real) x); }
> ```
> 
> Just one of many functions still operating with `real` precision only.

Ugh.  Not this again. :-(  Didn't somebody clean up std.math recently to
add double/float overloads?  Or was that limited to only a few
functions?

This really needs to be fixed sooner rather than later.  It's an
embarrassment to D for anyone who cares about floating-point
performance.


T

-- 
This is not a sentence.


More information about the Digitalmars-d mailing list