Merge branch 'develop-evmcc' of https://github.com/imapp-pl/ethereum into develop-evmcc

This commit is contained in:
Paweł Bylica 2014-10-02 13:59:15 +02:00
commit 20cd698cf8
5 changed files with 28 additions and 0 deletions

View file

@ -286,6 +286,26 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
break;
}
case Instruction::LT:
{
auto lhs = stack.pop();
auto rhs = stack.pop();
auto res1 = builder.CreateICmpULT(lhs, rhs);
auto res256 = builder.CreateZExt(res1, Types.word256);
stack.push(res256);
break;
}
case Instruction::GT:
{
auto lhs = stack.pop();
auto rhs = stack.pop();
auto res1 = builder.CreateICmpUGT(lhs, rhs);
auto res256 = builder.CreateZExt(res1, Types.word256);
stack.push(res256);
break;
}
case Instruction::NOT:
{
auto top = stack.pop();

1
evmcc/bytecode/for1.evm Normal file
View file

@ -0,0 +1 @@
600a60805460006080530b0f60255960a0536080530160a054600160805303608054600558

1
evmcc/bytecode/for2.evm Normal file
View file

@ -0,0 +1 @@
6000608054600a6080530a0f60255960a0536080530160a054600160805301608054600558

3
evmcc/lll/for1.lll Normal file
View file

@ -0,0 +1,3 @@
(for [i]:10 (> @i 0) [i](- @i 1)
[j](+ @i @j)
)

3
evmcc/lll/for2.lll Normal file
View file

@ -0,0 +1,3 @@
(for [i]:0 (< @i 10) [i](+ @i 1)
[j](+ @i @j)
)