EIP 145: Bitwise shifting instructions in EVM (#8451)
* Add SHL, SHR, SAR opcodes * Add have_bitwise_shifting schedule flag * Add all EIP tests for SHL * Add SHR implementation and tests * Implement SAR and add tests * Add eip145transition config param * Change map_or to map_or_else when possible
This commit is contained in:
@@ -187,6 +187,9 @@ lazy_static! {
|
||||
arr[OR as usize] = InstructionInfo::new("OR", 2, 1, GasPriceTier::VeryLow);
|
||||
arr[XOR as usize] = InstructionInfo::new("XOR", 2, 1, GasPriceTier::VeryLow);
|
||||
arr[BYTE as usize] = InstructionInfo::new("BYTE", 2, 1, GasPriceTier::VeryLow);
|
||||
arr[SHL as usize] = InstructionInfo::new("SHL", 2, 1, GasPriceTier::VeryLow);
|
||||
arr[SHR as usize] = InstructionInfo::new("SHR", 2, 1, GasPriceTier::VeryLow);
|
||||
arr[SAR as usize] = InstructionInfo::new("SAR", 2, 1, GasPriceTier::VeryLow);
|
||||
arr[ADDMOD as usize] = InstructionInfo::new("ADDMOD", 3, 1, GasPriceTier::Mid);
|
||||
arr[MULMOD as usize] = InstructionInfo::new("MULMOD", 3, 1, GasPriceTier::Mid);
|
||||
arr[SIGNEXTEND as usize] = InstructionInfo::new("SIGNEXTEND", 2, 1, GasPriceTier::Low);
|
||||
@@ -354,6 +357,12 @@ pub const XOR: Instruction = 0x18;
|
||||
pub const NOT: Instruction = 0x19;
|
||||
/// retrieve single byte from word
|
||||
pub const BYTE: Instruction = 0x1a;
|
||||
/// shift left operation
|
||||
pub const SHL: Instruction = 0x1b;
|
||||
/// logical shift right operation
|
||||
pub const SHR: Instruction = 0x1c;
|
||||
/// arithmetic shift right operation
|
||||
pub const SAR: Instruction = 0x1d;
|
||||
|
||||
/// compute SHA3-256 hash
|
||||
pub const SHA3: Instruction = 0x20;
|
||||
@@ -589,4 +598,3 @@ pub const REVERT: Instruction = 0xfd;
|
||||
pub const STATICCALL: Instruction = 0xfa;
|
||||
/// halt execution and register account for later deletion
|
||||
pub const SUICIDE: Instruction = 0xff;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user