mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
fixed implementation of NOT
This commit is contained in:
parent
fa76d7a4a0
commit
8b625fa954
4 changed files with 15 additions and 2 deletions
|
|
@ -290,8 +290,8 @@ std::unique_ptr<llvm::Module> Compiler::compile(const dev::bytes& bytecode)
|
||||||
{
|
{
|
||||||
auto top = stack.pop();
|
auto top = stack.pop();
|
||||||
auto zero = ConstantInt::get(Types.word256, 0);
|
auto zero = ConstantInt::get(Types.word256, 0);
|
||||||
auto nonzero = builder.CreateICmpNE(top, zero, "nonzero");
|
auto iszero = builder.CreateICmpEQ(top, zero, "iszero");
|
||||||
auto result = builder.CreateZExt(nonzero, Types.word256);
|
auto result = builder.CreateZExt(iszero, Types.word256);
|
||||||
stack.push(result);
|
stack.push(result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
evmcc/bytecode/when1.evm
Normal file
1
evmcc/bytecode/when1.evm
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
60010f600b59600d608054
|
||||||
10
evmcc/lll/when1.asm
Normal file
10
evmcc/lll/when1.asm
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
.code:
|
||||||
|
PUSH 1
|
||||||
|
NOT
|
||||||
|
PUSH [tag0]
|
||||||
|
JUMPI
|
||||||
|
PUSH 13
|
||||||
|
PUSH 128
|
||||||
|
MSTORE
|
||||||
|
tag0:
|
||||||
|
|
||||||
2
evmcc/lll/when1.lll
Normal file
2
evmcc/lll/when1.lll
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
(when (> 1 0) [i] 13)
|
||||||
|
|
||||||
Loading…
Reference in a new issue