Skip to content
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

Support new memory instructions and native alignment #102

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

shermike
Copy link
Contributor

All frontend fixes related to 256-bit alignment were removed.

The main components affected by the new aligment:

  • Lowering: several nodes require custom lowering due to operands with unsuitable
    types(not i256).
  • Stack allocation: it still uses 256-bits slots for spill/fills, but memory for
    the local data could not be aligned in 256-bits. Thus, it should be taken into
    account and properly handled by EVMStackAllocation and EVMConvertRegToStack.
  • MC and Linker: now we can't treat all integers as 256-bits, therefore the MC
    emitter produces object files with more detailed description of data. Linker
    in turn supports this new description and support init data, which is not
    256-bit aligned now.

Also added ability to use evmone as a VM for testing. But it has a drawback:
it doesn't support precompiled contracts, so test for __evm_builtin_modpow is
disabled for a while.

Also, due to proper data size and alignment, memset function is working
correctly now. So it's test was enabled.

Signed-off-by: Mikhail Sherstennikov <[email protected]>
All frontend fixes related to 256-bit alignment were removed.

The main components affected by the new aligment:
- Lowering: several nodes require custom lowering due to operands with unsuitable
  types(not i256).
- Stack allocation: it still uses 256-bits slots for spill/fills, but memory for
  the local data could not be aligned in 256-bits. Thus, it should be taken into
  account and properly handled by EVMStackAllocation and EVMConvertRegToStack.
- MC and Linker: now we can't treat all integers as 256-bits, therefore the MC
  emitter produces object files with more detailed description of data. Linker
  in turn supports this new description and support init data, which is not
  256-bit aligned now.

Also added ability to use `evmone` as a VM for testing. But it has a drawback:
it doesn't support precompiled contracts, so test for __evm_builtin_modpow is
disabled for a while.

Also, due to proper data size and alignment, `memset` function is working
correctly now. So it's test was enabled.

Signed-off-by: Mikhail Sherstennikov <[email protected]>
@shermike
Copy link
Contributor Author

shermike commented Jan 3, 2024

cc @avm

@shermike shermike merged commit 97f7e56 into evm-compiler Jan 3, 2024
1 check passed
@shermike shermike deleted the evm-fix-alignment branch January 3, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants