-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Issue 3632 - modify float is float to do a bitwise compare #13780
Conversation
|
Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#13780" |
cb7be26 to
021061c
Compare
|
Currently fails on Windows: That's template T46(double v)
{
double T46 = v;
}
void test46()
{
double g = T46!(double.nan) + T46!(-double.nan);
} |
src/dmd/e2ir.d
Outdated
| @@ -2024,7 +2024,11 @@ extern (C++) class ToElemVisitor : Visitor | |||
| elem *es2 = toElem(ie.e2, irs); | |||
| es2 = addressElem(es2, ie.e2.type); | |||
| e = el_param(es1, es2); | |||
| elem *ecount = el_long(TYsize_t, t1.size()); | |||
| elem *ecount; | |||
| if (t1.ty == TY.Tfloat80) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a ternary + comment and link to issue appreciated since the glue code is horrible as it is.
|
Ready for review now. It does not fix constant folding yet, that's now a separate issue: It also doesn't change complex numbers, because those are deprecated any way. |
|
cc @kinke does LDC still have that real padding issue? |
|
The padding is still undefined (edit: for |
src/dmd/ctfeexpr.d
Outdated
| @@ -1408,6 +1408,34 @@ bool ctfeIdentity(const ref Loc loc, EXP op, Expression e1, Expression e2) | |||
| complex_t v2 = e2.toComplex(); | |||
| cmp = RealIdentical(creall(v1), creall(v2)) && RealIdentical(cimagl(v1), cimagl(v1)); | |||
| } | |||
| else if (e1.op == EXP.structLiteral || e2.op == EXP.structLiteral) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's all this struct literal business, does it have anything to do with floating-point identity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I did not originally write it, I rebased Iain's PR which rebased another PR from 2013. I removed it and modified ctfeRawCmp now.
Reboot of #7568