Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Opcode SHL #157

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1714ac5
Add `ShlGadget`.
silathdiir May 19, 2022
558fd36
Add `ShlWordsGadget` to `math_gadget.rs`.
silathdiir May 19, 2022
4dd4f9b
Merge remote-tracking branch 'origin/main' into feat/opcode-shl
silathdiir Jun 4, 2022
85686bb
Merge remote-tracking branch 'origin/main' into feat/opcode-shl
silathdiir Jun 10, 2022
7cbbe28
Merge remote-tracking branch 'origin/main' into feat/opcode-shl
silathdiir Jun 11, 2022
d738dd4
Merge both opcode `SHL` and `SHR` into `MulDivModShlShrGadget.
silathdiir Jun 12, 2022
eb89a00
Add test cases.
silathdiir Jun 12, 2022
a57c20e
Delete old `SHL` and `SHR` gadgets.
silathdiir Jun 12, 2022
df635e7
Use `generate_lagrange_base_polynomial` to check opcode (as `is_mul`)
silathdiir Jun 14, 2022
0f59351
Add a constraint `pop1 == pop1.cells[0] when divisor != 0 for opcode …
silathdiir Jun 14, 2022
7d187ed
Add `shf_mod64` and `shf_div64` lookup constraints for opcode `SHL` and
silathdiir Jun 15, 2022
45a37bd
Fix Infra doc issue.
silathdiir Jun 15, 2022
dbcb834
Fix `shf_div64` and `shf_mod64` to `shf_div128` and `shf_mod128`.
silathdiir Jun 15, 2022
de5caed
Delete commenting for tests.
silathdiir Jun 15, 2022
a0c98b3
Merge remote-tracking branch 'origin/main' into feat/opcode-shl
silathdiir Jun 15, 2022
b0655f1
Fix contraint `divisor_hi == shf_div128`.
silathdiir Jun 15, 2022
51bd0a2
Fix clippy issue.
silathdiir Jun 15, 2022
b99dc14
Fix comments.
silathdiir Jun 15, 2022
d450aaf
Fix to `shf_lo` and `shf_hi`.
silathdiir Jun 15, 2022
926a4da
Merge remote-tracking branch 'origin/main' into feat/opcode-shl
silathdiir Jun 16, 2022
c763b78
Merge remote-tracking branch 'origin/main' into feat/opcode-shl
silathdiir Jun 17, 2022
98c0ef3
Fix `Pow2` lookup table and update to use `shf0` for lookup.
silathdiir Jun 18, 2022
eaba996
Add missing limit `divisor != 0` for `Pow2` lookup.
silathdiir Jun 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions zkevm-circuits/src/evm_circuit/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ mod logs;
mod memory;
mod memory_copy;
mod msize;
mod mul_div_mod;
mod mul_div_mod_shl_shr;
mod mulmod;
mod origin;
mod pc;
mod pop;
mod push;
mod selfbalance;
mod shr;
mod signed_comparator;
mod signextend;
mod sload;
Expand Down Expand Up @@ -103,14 +102,13 @@ use logs::LogGadget;
use memory::MemoryGadget;
use memory_copy::CopyToMemoryGadget;
use msize::MsizeGadget;
use mul_div_mod::MulDivModGadget;
use mul_div_mod_shl_shr::MulDivModShlShrGadget;
use mulmod::MulModGadget;
use origin::OriginGadget;
use pc::PcGadget;
use pop::PopGadget;
use push::PushGadget;
use selfbalance::SelfbalanceGadget;
use shr::ShrGadget;
use signed_comparator::SignedComparatorGadget;
use signextend::SignextendGadget;
use sload::SloadGadget;
Expand Down Expand Up @@ -180,14 +178,13 @@ pub(crate) struct ExecutionConfig<F> {
log_gadget: LogGadget<F>,
memory_gadget: MemoryGadget<F>,
msize_gadget: MsizeGadget<F>,
mul_div_mod_gadget: MulDivModGadget<F>,
mul_div_mod_shl_shr_gadget: MulDivModShlShrGadget<F>,
mulmod_gadget: MulModGadget<F>,
origin_gadget: OriginGadget<F>,
pc_gadget: PcGadget<F>,
pop_gadget: PopGadget<F>,
push_gadget: PushGadget<F>,
selfbalance_gadget: SelfbalanceGadget<F>,
shr_gadget: ShrGadget<F>,
sha3_gadget: DummyGadget<F, 2, 1, { ExecutionState::SHA3 }>,
signed_comparator_gadget: SignedComparatorGadget<F>,
signextend_gadget: SignextendGadget<F>,
Expand Down Expand Up @@ -373,15 +370,14 @@ impl<F: Field> ExecutionConfig<F> {
log_gadget: configure_gadget!(),
memory_gadget: configure_gadget!(),
msize_gadget: configure_gadget!(),
mul_div_mod_gadget: configure_gadget!(),
mul_div_mod_shl_shr_gadget: configure_gadget!(),
mulmod_gadget: configure_gadget!(),
origin_gadget: configure_gadget!(),
pc_gadget: configure_gadget!(),
pop_gadget: configure_gadget!(),
push_gadget: configure_gadget!(),
selfbalance_gadget: configure_gadget!(),
sha3_gadget: configure_gadget!(),
shr_gadget: configure_gadget!(),
signed_comparator_gadget: configure_gadget!(),
signextend_gadget: configure_gadget!(),
sload_gadget: configure_gadget!(),
Expand Down Expand Up @@ -811,7 +807,9 @@ impl<F: Field> ExecutionConfig<F> {
ExecutionState::LOG => assign_exec_step!(self.log_gadget),
ExecutionState::MEMORY => assign_exec_step!(self.memory_gadget),
ExecutionState::MSIZE => assign_exec_step!(self.msize_gadget),
ExecutionState::MUL_DIV_MOD => assign_exec_step!(self.mul_div_mod_gadget),
ExecutionState::MUL_DIV_MOD_SHL_SHR => {
assign_exec_step!(self.mul_div_mod_shl_shr_gadget)
}
ExecutionState::MULMOD => assign_exec_step!(self.mulmod_gadget),
ExecutionState::ORIGIN => assign_exec_step!(self.origin_gadget),
ExecutionState::PC => assign_exec_step!(self.pc_gadget),
Expand All @@ -823,7 +821,6 @@ impl<F: Field> ExecutionConfig<F> {
ExecutionState::BLOCKCTXU256 => assign_exec_step!(self.block_ctx_u256_gadget),
ExecutionState::SELFBALANCE => assign_exec_step!(self.selfbalance_gadget),
ExecutionState::SHA3 => assign_exec_step!(self.sha3_gadget),
ExecutionState::SHR => assign_exec_step!(self.shr_gadget),
ExecutionState::SIGNEXTEND => assign_exec_step!(self.signextend_gadget),
ExecutionState::SLOAD => assign_exec_step!(self.sload_gadget),
ExecutionState::SSTORE => assign_exec_step!(self.sstore_gadget),
Expand Down
238 changes: 0 additions & 238 deletions zkevm-circuits/src/evm_circuit/execution/mul_div_mod.rs

This file was deleted.

Loading