std.math performance (SSE vs. real)

Jerry via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 26 20:28:22 PDT 2014


"H. S. Teoh via Digitalmars-d" <digitalmars-d at puremagic.com> writes:

> On Fri, Jun 27, 2014 at 02:09:59AM +0000, Tofu Ninja via Digitalmars-d wrote:
>> On Friday, 27 June 2014 at 01:31:17 UTC, David Nadlinger wrote:
> [...]
>> >Because of this, I propose to add float and double overloads (at the
>> >very least the double ones) for all of the commonly used functions in
>> >std.math.  This is unlikely to break much code, but:
>> > a) Somebody could rely on the fact that the calls effectively widen
>> > the calculation to 80 bits on x86 when using type deduction.
>> > b) Additional overloads make e.g. "&floor" ambiguous without
>> > context, of course.
>> >
>> >What do you think?
> [...]
>> I honestly alway thought that it was a little odd that it forced
>> conversion to real. Personally I support this. It would also make
>> generic code that calls math functions more simple as it wouldn't
>> require casts back.
>
> I support this too.

Me three.  This seems like an unnecessary pessimisation and it would be
irritating for D to become associated with slow fp math.


More information about the Digitalmars-d mailing list