0xPolygonZero / zk_evm

Apache License 2.0
80 stars 35 forks source link

perf: Remove some binary ops & make KERNEL `init` section free of logic operations #658

Closed Nashtare closed 3 days ago

Nashtare commented 5 days ago

Removes the 3 logic operations initially required by the segmentation mechanism (at the cost of ~3 extra~ 1 extra CPU cycle per segment), to allow for full removal of LogicStark table when possible, following @sai-deng's approach on the Keccak table.

Also did a pass on binary ops in the Kernel, as most of them could be expressed differently at no extra cost, to try make it even more likely to happen (simple_transfer goes from 1112 to 173 binary ops).