Add simplification rule for SDIV(0,X) and SDIV(X,0)

This commit is contained in:
Alex Beregszaszi 2017-05-10 10:34:37 +01:00
parent dc8eb3d846
commit af3a4b0642

View File

@ -132,6 +132,8 @@ Rules::Rules()
{{Instruction::DIV, {X, 0}}, [=]{ return u256(0); }},
{{Instruction::DIV, {0, X}}, [=]{ return u256(0); }},
{{Instruction::DIV, {X, 1}}, [=]{ return X; }},
{{Instruction::SDIV, {X, 0}}, [=]{ return u256(0); }},
{{Instruction::SDIV, {0, X}}, [=]{ return u256(0); }},
{{Instruction::SDIV, {X, 1}}, [=]{ return X; }},
{{Instruction::AND, {X, ~u256(0)}}, [=]{ return X; }},
{{Instruction::AND, {X, 0}}, [=]{ return u256(0); }},