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
YJIT: Allow testing assembler with disasm #7470
Conversation
This is clever, but I want to be strict about minimizing dependencies, even if they are used only during development. I would rather not merge this at this time. |
How about this? 57a26a4 I removed new dependencies. |
Still not a huge fan of adding a dev dependency or relying on the output of capstone and string processing 😅 Let's ask @XrXr what his opinion is when he is back next week. |
I thought about doing something like this before and never got around to it. Thanks for looking into this! Being able to see the disassembly make these much easier to read. In terms of dev dependency, I think we can make it test the disassembly optionally. So we would have something like:
Some string manipulation to deindent is probably necessary, but maybe we can do less of it by not testing the addresses; I don't think the addresses are awfully important. I'm less concerned about Capstone because it seems to be reliable WRT always giving the same output. |
I was on the fence, but since Alan is in favor, let's go forward with this 👍 |
Ah, I had forgotten that we were passing addresses to
👍 |
cb8b053
to
accc9fe
Compare
accc9fe
to
05c9865
Compare
This PR proposes an alternative way to write assembler tests, rewriting tests of #7453 as a starter.
I don't really memorize how x86_64 instructions are encoded, so it's hard for me to read these test cases. Ideally, I'd like to test the generated code using disasm, assuming libcapstone is not broken. A challenge in it is that addresses in generated code are always different, so those values are replaced with
start_addr
-origin values.