Implement bit operations.

This commit is contained in:
chriseth
2020-04-16 00:33:45 +02:00
parent 10879bcae6
commit 06adbc2c59
2 changed files with 28 additions and 0 deletions
@@ -0,0 +1,19 @@
contract test {
uint8 x;
uint v;
function f() public returns (uint x, uint y, uint z) {
uint16 a;
uint32 b;
assembly {
a := 0x0f0f0f0f0f
b := 0xff0fff0fff
}
x = a & b;
y = a | b;
z = a ^ b;
}
}
// ====
// compileViaYul: also
// ----
// f() -> 3855, 268374015, 268370160