-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement parsing EraVM assembler #448
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
It looks like there are plenty of functional and non-functional changes combined in this PR, so it's hard to review. Can we divide the functionality to meaningful commits and review them one by one? I mean divide to less than 114 commits; form a commit structure as we actually plan to land these changes. |
The commits itself are quite well-divided and represent fine-grained incremental set of changes, I would say there are almost no non-functional changes. However, we had to restructure the instructions definitions entirely as in the original form they were unsuitable for instruction encoding and had some inherent issues. Certainly, some commits could be combined, for example:
Let me know if you'd want us to do this. |
@asl it sounds like a reasonable change. I think we should go for it. |
We are working on silencing linter warnings. |
Lit Tests Results 3 files ± 0 4 suites ±0 6m 45s ⏱️ +9s Results for commit f0d5f46. ± Comparison against base commit 8677f09. This pull request removes 1 and adds 25 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
@hedgar2017 @akiramenai @sayon Looks like the integration tests fail because they use standalone assembler that cannot handle the assembler syntax described in the spec. How would you want to address this? |
207abbe
to
6e0f045
Compare
@asl |
@akiramenai Yes, the renaming is a part of https://github.com/matter-labs/compiler-llvm/issues/441 However, it looks like there are 3 different sources of information that do no correspond to each other: backend, assembler and the ISA spec. There were some obsolete instructions, some obsolete syntax, some undocumented syntax, etc. So, in such cases we had to resort to the existing spec as an ultimate source of information. Some changes (e.g. removal of obsolete stuff) is certainly a part of initial code drop as it does not make any sense to make them supported only to remove them immediately afterwards. In this particular case, it seems that standalone assembler does not support |
@asl |
@asl I asked @sayon, [cc @shamatar] |
@akiramenai @asl @sayon I'd kindly ask you guys to remove all aliases as soon as possible (e.g. the |
Absolutely. However, here we are having chicken-and-egg problem: existing assembler supports only some aliases, but not others (e.g. However, we structured the changes in such way so it will be more or less straightforward. |
I pushed a few commits that (temporary?) rollback potentially breaking changes to syntax. Let's see if tests pass. |
I have pushed more updates to the the spec available online; now the returns are properly categorized:
This type specifies the abstract syntax of the programmer-facing assembler instructions: |
Benchmark results:
|
@akiramenai What does "exec format error" error mean? |
Understood! |
@asl, I have never seen that before. But from the fact that only Viper programs are affected I infer that it's likely to be a CI issue. Could you rebase the work on ToT? |
Here is an idea: we do have a set of assembler files (under |
@hedgar2017 we can migrate I think. Binary comparison is faster though, could have less dependence, and could identify issues that aren't touched by input data. |
I can only see LIT failures on CI. Could you point me directly? |
Binary comparison isn't faster than simply running the CI after migration. I'll see if I can do some hacking like dump all builds from compiler-tester. |
… for binary instructions
34429b2
to
b5903fa
Compare
@akiramenai Looks like there is unresolved conversation that was attached to a commit that does not exist anymore. As a result, the PR cannot be merged :) For the record, the comment was resolved. |
This PR contains implementation of assembler parser for EraVM target as well as several refactorings made to backend's internal representation of EraVM instructions.
Related issues: #411, #412, #414, #416, #417, #418, #419, #420, #421, #422, #423, #435.