Browse Source

Bitwise operators: AND, OR, XOR

cl-refactor
Paweł Bylica 10 years ago
parent
commit
48897f42c8
  1. 27
      evmcc/Compiler.cpp

27
evmcc/Compiler.cpp

@ -315,6 +315,33 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
stack.push(result);
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:
{

Loading…
Cancel
Save