Replace XOR/ISZERO with EQ

This commit is contained in:
Alex Beregszaszi 2016-11-09 02:22:54 +00:00
parent 25160bfc26
commit b8bba66220

View File

@ -288,6 +288,10 @@ Rules::Rules()
{Instruction::ISZERO, {{Instruction::ISZERO, {{Instruction::ISZERO, {X}}}}}}, {Instruction::ISZERO, {{Instruction::ISZERO, {{Instruction::ISZERO, {X}}}}}},
[=]() -> Pattern { return {Instruction::ISZERO, {X}}; } [=]() -> Pattern { return {Instruction::ISZERO, {X}}; }
}); });
m_rules.push_back({
{Instruction::ISZERO, {{Instruction::XOR, {X, Y}}}},
[=]() -> Pattern { return { Instruction::EQ, {X, Y} }; }
});
// Associative operations // Associative operations
for (auto const& opFun: vector<pair<Instruction,function<u256(u256 const&,u256 const&)>>>{ for (auto const& opFun: vector<pair<Instruction,function<u256(u256 const&,u256 const&)>>>{
{Instruction::ADD, plus<u256>()}, {Instruction::ADD, plus<u256>()},