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
runtime: mkfastlog2table produces different output on darwin/arm64 #49891
Comments
Is this a change due to registerization of arguments? Or some other optimization? It's just the last digit changing, but it would be nice to understand why. |
I see that's a different generator. That one's easy to fix. |
We don't need to regenerate and commit. The table is only used to get 5 digits of log. It is still interesting to find out why arm64 produces slightly different numbers. We have excised all the 387 intrinsics, so that's not it. I thought maybe the x86-64 asm was producing a different answer from the pure Go that arm64 would use, but setting haveArchLog = false in math/log_asm.go on x86-64 did not change the behavior of mkfastlog2table. At that point I think it's all pure Go code - Log2 calls Log calls Frexp, and only Log had any assembly (on x86-64). It's a bit concerning but not enough to block the release. |
Could be FMA on arm64. |
log2 itself is a single FMA. Could be. |
I've verified that disabling FMA in |
Phew. So now it's just a question of finding a way to make the generator programs stable and match the existing runtime directory. |
I think the easiest thing would be just to copy |
This doesn't seem like it's necessarily a new issue in this release, and it certainly shouldn't block it. Moving this to the 1.19 milestone for now. |
Rolling forward to 1.20. Please comment if you disagree. Thanks. |
Change https://go.dev/cl/413976 mentions this issue: |
This lets us generate identical copies of fastlog2table.go on all hosts. Tested by regenerating fastlog2table.go on linux-amd64 and darwin-arm64. Fixes golang#49891 Change-Id: I279d6b5abb5a5290c049d9658050fd9c8d0c0190 Reviewed-on: https://go-review.googlesource.com/c/go/+/413976 Run-TryBot: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
On darwin/arm64 at 3ca57c7 (Nov 29, 2021), running
go generate
in package runtime generates a diff:Should we regenerate and commit prior to the release?
The text was updated successfully, but these errors were encountered: