mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
Bitwise operators: AND, OR, XOR
This commit is contained in:
parent
c002d9b843
commit
48897f42c8
1 changed files with 27 additions and 0 deletions
|
|
@ -315,6 +315,33 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
|
||||||
stack.push(result);
|
stack.push(result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Instruction::AND:
|
||||||
|
{
|
||||||
|
auto lhs = stack.pop();
|
||||||
|
auto rhs = stack.pop();
|
||||||
|
auto res = builder.CreateAnd(lhs, rhs);
|
||||||
|
stack.push(res);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Instruction::OR:
|
||||||
|
{
|
||||||
|
auto lhs = stack.pop();
|
||||||
|
auto rhs = stack.pop();
|
||||||
|
auto res = builder.CreateOr(lhs, rhs);
|
||||||
|
stack.push(res);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Instruction::XOR:
|
||||||
|
{
|
||||||
|
auto lhs = stack.pop();
|
||||||
|
auto rhs = stack.pop();
|
||||||
|
auto res = builder.CreateXor(lhs, rhs);
|
||||||
|
stack.push(res);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case Instruction::POP:
|
case Instruction::POP:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue