-
Notifications
You must be signed in to change notification settings - Fork 302
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
baseline: Use custom instruction table #341
Conversation
Codecov Report
@@ Coverage Diff @@
## master #341 +/- ##
=======================================
Coverage 99.78% 99.78%
=======================================
Files 29 30 +1
Lines 4133 4134 +1
=======================================
+ Hits 4124 4125 +1
Misses 9 9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Haswell 4.4 GHz, clang-12
|
lib/evmone/baseline.cpp
Outdated
|
||
if (instruction_names[op] == nullptr) | ||
if (metrics.gas_cost < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
if (metrics.gas_cost < 0) | |
if (metrics.gas_cost == instr::undefined) |
const auto gas_cost = instr::gas_costs<Rev>[i]; | ||
t.gas_cost = gas_cost; // Include instr::undefined in the table. | ||
t.stack_height_required = instr::traits[i].stack_height_required; | ||
t.can_overflow_stack = instr::traits[i].stack_height_change > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could add
static_assert(instr::traits[i].stack_height_change <= 1);
because the stack overflow check now assumes this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with assert()
.
@@ -0,0 +1,21 @@ | |||
// evmone: Fast Ethereum Virtual Machine implementation | |||
// Copyright 2020 The evmone Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright 2020 The evmone Authors. | |
// Copyright 2021 The evmone Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These commits are from December 2020 :)
d53494e
to
f5c2f1d
Compare
f5c2f1d
to
f8900a2
Compare
New benchmarks for execute only:
|
Previously EVMC instruction tables were used (for quick head start).
Now two EVMC tables are replaced with single one. This at least cuts memory bandwidth from 12 bytes to 4 bytes per instruction.
Changes to instruction requirements checks are minimal but the stack overflow is checked differently.
The check can be further optimized but this will be done separately.