-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: math.Sqrt mishandled when GOARM=5 #10641
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
Comments
Dup of #10629? |
This was caused by https://go-review.googlesource.com/8356, which failed on the linux-arm-arm5 builder (whereas the previous build completed successfully). |
@josharian it would seem so (I had searched with "softfloat" instead of "soft float" - seems github is not smart enough to find it :) - I'm reluctant to close this in favour of the other issue since there is a reproducible test case and assembly dumps here... |
Closed #10629; we'll leave this one. |
Thanks for the much more through issue report. On Fri, 1 May 2015 02:27 Josh Bleecher Snyder notifications@github.com
|
I've just sent https://go-review.googlesource.com/9524 to disable OSQRT on GOARM=5, which avoids producing incorrect results until the actual problem can be found/fixed. |
CL https://golang.org/cl/9524 mentions this issue. |
It's a runtime bug.
When emulating the SQRT instruction, the runtime.sqrt function itself
uses software floating point instructions, which clobbers the user software
fp registers.
|
CL https://golang.org/cl/9570 mentions this issue. |
OSQRT currently produces incorrect results when used on arm with softfloat. Disable it on GOARM=5 until the actual problem is found and fixed. Updates golang#10641 Change-Id: Ia6f6879fbbb05cb24399c2feee93c1be21113e73 Reviewed-on: https://go-review.googlesource.com/9524 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net>
CL https://golang.org/cl/9720 mentions this issue. |
I just submitted the real fix for #10641. This reverts commit 3120adc. Change-Id: I55051515f697e27ca887ed21c2ac985f0b9b062b Reviewed-on: https://go-review.googlesource.com/9720 Reviewed-by: Joel Sing <jsing@google.com>
Currently GOARM=5 platforms (on at least the linux-arm-arm5 and openbsd-arm builders) are failing the
test/bench/shootout/nbody
test due to invalid floating point results - this appears to be caused by a compiler or softfloat related bug. The failure is reproducible with the following:Adding a
fmt.Println(dSquared)
immediately after dSquared is assigned "fixes" the problem and produces correct results.The main from
go tool objdump
of the broken version contains:While the working version with the additional
fmt.Println
has:The text was updated successfully, but these errors were encountered: