Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Implement bitwise shifting (EIP145) #4054

Merged
merged 8 commits into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libethcore/EVMSchedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct EVMSchedule
bool haveDelegateCall = true;
bool eip150Mode = false;
bool eip158Mode = false;
bool haveBitwiseShifting = false;
bool haveRevert = false;
bool haveReturnData = false;
bool haveStaticCall = false;
Expand Down Expand Up @@ -130,6 +131,7 @@ static const EVMSchedule ConstantinopleSchedule = []
EVMSchedule schedule = ByzantiumSchedule;
schedule.blockhashGas = 800;
schedule.haveCreate2 = true;
schedule.haveBitwiseShifting = true;
return schedule;
}();

Expand Down
3 changes: 3 additions & 0 deletions libevm/Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
{ Instruction::OR, { "OR", 0, 2, 1, Tier::VeryLow } },
{ Instruction::XOR, { "XOR", 0, 2, 1, Tier::VeryLow } },
{ Instruction::BYTE, { "BYTE", 0, 2, 1, Tier::VeryLow } },
{ Instruction::SHL, { "SHL", 0, 2, 1, Tier::VeryLow } },
{ Instruction::SHR, { "SHR", 0, 2, 1, Tier::VeryLow } },
{ Instruction::SAR, { "SAR", 0, 2, 1, Tier::VeryLow } },
{ Instruction::ADDMOD, { "ADDMOD", 0, 3, 1, Tier::Mid } },
{ Instruction::MULMOD, { "MULMOD", 0, 3, 1, Tier::Mid } },
{ Instruction::SIGNEXTEND, { "SIGNEXTEND", 0, 2, 1, Tier::Low } },
Expand Down
5 changes: 4 additions & 1 deletion libevm/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ enum class Instruction: uint8_t
AND, ///< bitwise AND operation
OR, ///< bitwise OR operation
XOR, ///< bitwise XOR operation
NOT, ///< bitwise NOT opertation
NOT, ///< bitwise NOT operation
BYTE, ///< retrieve single byte from word
SHL, ///< logical shift left operation
SHR, ///< logical shift right operation
SAR, ///< arithmetic shift right operation

SHA3 = 0x20, ///< compute SHA3-256 hash

Expand Down
Loading