Skip to content

std.math: added frexp for double and float#2508

Merged
quickfur merged 4 commits intodlang:masterfrom
9il:frexp-single-double
Sep 16, 2014
Merged

std.math: added frexp for double and float#2508
quickfur merged 4 commits intodlang:masterfrom
9il:frexp-single-double

Conversation

@9il
Copy link
Member

@9il 9il commented Sep 10, 2014

For speed.

@dnadlinger
Copy link
Contributor

Pinging @ibuclaw for review. Hopefully I'll be able to look into the intrinsics side of things soon.

@9il 9il mentioned this pull request Sep 10, 2014
@9il 9il changed the title added frexp for double and single std.math: added frexp for double and single Sep 11, 2014
@9il 9il changed the title std.math: added frexp for double and single std.math: added frexp for double and float Sep 11, 2014
@9il 9il closed this Sep 13, 2014
@9il 9il reopened this Sep 13, 2014
@ibuclaw
Copy link
Member

ibuclaw commented Sep 15, 2014

Looks fine to me.

std/math.d Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: please indent the sig constraint by 4 spaces.

std/math.d Outdated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I remove prototypes and leave only template?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prototypes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stuff:

///ditto
double frexp(double value, out int exp) @trusted pure nothrow @nogc
{ return frexpImpl(value, exp); }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example isNaN is a template.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could try it, but I remember recently there was a problem where the compiler autopromoted everything to double (or was it real?), resulting in inefficient generated code. You'll have to check the disassembly to make sure this isn't happening if you remove the "prototypes".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A have checked 32/64 bit, with and without -O. All works fine.

@quickfur
Copy link
Member

LGTM.

@quickfur
Copy link
Member

Auto-merge toggled on

@9il
Copy link
Member Author

9il commented Sep 16, 2014

Thanks!

quickfur pushed a commit that referenced this pull request Sep 16, 2014
std.math: added frexp for double and float
@quickfur quickfur merged commit 33956f1 into dlang:master Sep 16, 2014
@9il 9il deleted the frexp-single-double branch September 16, 2014 19:29
@9il 9il mentioned this pull request Feb 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants