Skip to content
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

cmd/compile: ideal floats should not have a -0 #12577

Closed
randall77 opened this issue Sep 10, 2015 · 1 comment
Closed

cmd/compile: ideal floats should not have a -0 #12577

randall77 opened this issue Sep 10, 2015 · 1 comment
Milestone

Comments

@randall77
Copy link
Contributor

According to the spec, ideal floats do not have a -0. However, -0 is representable (and used) by the compiler's internal ideal float implementation. Fix the implementation to get rid of -0 (or hide it from the rest of the compiler).

See issue #12576

The compiler uses cmd/compile/internal/gc/mpgetflt{32} to do the conversion. Maybe a check inside this routine is enough?

We've had to sprinkle +0.0 around to get around this problem, like this:
s.constFloat32(n.Type, mpgetflt32(f)+0.0)

@griesemer griesemer added this to the Go1.6 milestone Sep 30, 2015
@gopherbot
Copy link

CL https://golang.org/cl/16133 mentions this issue.

@golang golang locked and limited conversation to collaborators Oct 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants