Add more binary operations to the yul proto spec.

This commit is contained in:
Bhargava Shastry 2019-03-14 22:26:25 +01:00
parent 48f0d41cc5
commit 5e8ed426df
2 changed files with 44 additions and 0 deletions

View File

@ -102,6 +102,39 @@ ostream& yul::test::yul_fuzzer::operator<<(ostream& _os, BinaryOp const& _x)
case BinaryOp::GT: case BinaryOp::GT:
_os << "gt"; _os << "gt";
break; break;
case BinaryOp::SHR:
_os << "shr";
break;
case BinaryOp::SHL:
_os << "shl";
break;
case BinaryOp::SAR:
_os << "sar";
break;
case BinaryOp::SDIV:
_os << "sdiv";
break;
case BinaryOp::SMOD:
_os << "smod";
break;
case BinaryOp::EXP:
_os << "exp";
break;
case BinaryOp::SLT:
_os << "slt";
break;
case BinaryOp::SGT:
_os << "sgt";
break;
case BinaryOp::BYTE:
_os << "byte";
break;
case BinaryOp::SI:
_os << "signextend";
break;
case BinaryOp::KECCAK:
_os << "keccak256";
break;
} }
return _os << "(" << _x.left() << "," << _x.right() << ")"; return _os << "(" << _x.left() << "," << _x.right() << ")";
} }

View File

@ -82,6 +82,17 @@ message BinaryOp {
EQ = 8; EQ = 8;
LT = 9; LT = 9;
GT = 10; GT = 10;
SHR = 11;
SHL = 12;
SAR = 13;
SDIV = 14;
SMOD = 15;
EXP = 16;
SLT = 17;
SGT = 18;
BYTE = 19;
SI = 20;
KECCAK = 21;
}; };
required BOp op = 1; required BOp op = 1;
required Expression left = 2; required Expression left = 2;