You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
490 B
41 lines
490 B
10 years ago
|
|
||
|
#include "Utils.h"
|
||
|
|
||
10 years ago
|
namespace dev
|
||
|
{
|
||
|
namespace eth
|
||
|
{
|
||
|
namespace jit
|
||
10 years ago
|
{
|
||
|
|
||
10 years ago
|
u256 llvm2eth(i256 _i)
|
||
10 years ago
|
{
|
||
10 years ago
|
u256 u = 0;
|
||
10 years ago
|
u |= _i.d;
|
||
|
u <<= 64;
|
||
|
u |= _i.c;
|
||
|
u <<= 64;
|
||
|
u |= _i.b;
|
||
|
u <<= 64;
|
||
|
u |= _i.a;
|
||
|
return u;
|
||
|
}
|
||
|
|
||
10 years ago
|
i256 eth2llvm(u256 _u)
|
||
10 years ago
|
{
|
||
|
i256 i;
|
||
10 years ago
|
u256 mask = 0xFFFFFFFFFFFFFFFF;
|
||
10 years ago
|
i.a = static_cast<uint64_t>(_u & mask);
|
||
|
_u >>= 64;
|
||
|
i.b = static_cast<uint64_t>(_u & mask);
|
||
|
_u >>= 64;
|
||
|
i.c = static_cast<uint64_t>(_u & mask);
|
||
|
_u >>= 64;
|
||
|
i.d = static_cast<uint64_t>(_u & mask);
|
||
|
return i;
|
||
|
}
|
||
|
|
||
10 years ago
|
}
|
||
|
}
|
||
|
}
|