-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/asm: how to test? #25724
Comments
Thank you for opening an issue. Please, correct me where I'm wrong. (quotes from https://go-review.googlesource.com/c/go/+/115858) From @ianlancetaylor :
We had x86test program written by Russ that generated amd64enc.s test suite. Many of those were commented-out with TODO comments, I've implemented missing instructions and performed uncommenting automatically with x86avxgen program (for legacy instruction, this was done by hand). From @robpike:
Because legacy x86 instruction already had coverage in amd64enc.s.
That may sound unfair, but if I'm working on x86 arch, it makes sense that I care more about that one. To conclude: x86 test suite has auto generated tests for both new and older instructions.
I agree on this one, but when I've joined the project, it already had big auto-generated asm test file. I though it's logical and consistent to add another one to make it cover new instructions. |
Also, I want to emphasize: |
CC @TocarIP |
I'll describe current situation to make this discussion easier. Just in case any details are missing from my previous responses.
With x86, it was "almost" exhaustive auto-generated tests for both legacy and AVX instructions. Hand-written tests also catch regression bugs. This is the current approach, we can discuss alternatives and improvements now, if the situation is clear. |
Where is the code for
Likewise, was I don't personally see the need to generate these test files on the fly. I tend to have a preference for keeping the files in the repo, but with a CI job that confirms they are in sync with the generator (for example run However I think it is is problematic if the programs that generated them are unavailable or out of sync. I don't have the same perspective as others here, so apologies if I'm speaking out of turn. It seems to me it would be great to get to the point where all x86 generated files in the Go repo can be reproduced from tools in
Ideally, some form of https://golang.org/cl/104496 could be landed as well. The goal would be that all these code generators take their input from the same (canonical) database of Go x86 instructions. Thoughts? I'm interested in contributing in these areas if I can be of use :) |
Ping @quasilyte - any chance of an update in response to @mmcloughlin? A few people are interested in picking up where you left off but it's unclear what the final state of things was. |
Thanks for the ping. I thought I answered @mmcloughlin, but seems I was distracted and completely forgot about it. |
Great, thanks @quasilyte! From my point of view it doesn't need to be clean at all, just throw up whatever you have on your machine :) The initial goal is just to get to the point where we can reproduce all these generated files, then we can consider any cleanup/refactor. |
Change https://golang.org/cl/170863 mentions this issue: |
The current tests are an inconsistent mess. Some files are hand-written. Others are auto-generated and enormous, and could be generated on the fly instead of being checked in. Some architectures are well tested. Others are not. Some subsets of architectures (AVX) are exhaustively tested. Others are not.
I would like a proper discussion about how to test the assembler (and the compiler, if you like). Without a clear picture, the tests will become enormous, wildly inconsistent, messy, and difficult to maintain.
The text was updated successfully, but these errors were encountered: