Skip to content

Commit 781d58c

Browse files
doc(benchmark): update doc string for supported ops
1 parent 27b5e21 commit 781d58c

14 files changed

+155
-52
lines changed

tests/benchmark/compute/instruction/test_account_query.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
"""
22
Benchmark operations that require querying the account state, either on the
33
current executing account or on a target account.
4+
5+
Supported Opcodes:
6+
- SELFBALANCE
7+
- CODESIZE
8+
- CODECOPY
9+
- EXTCODESIZE
10+
- EXTCODEHASH
11+
- EXTCODECOPY
12+
- BALANCE
413
"""
514

615
import math

tests/benchmark/compute/instruction/test_arithmetic.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
"""Benchmark arithmetic instructions."""
1+
"""
2+
Benchmark arithmetic instructions.
3+
4+
Supported Opcodes:
5+
- ADD
6+
- ADDMOD
7+
- MUL
8+
- MULMOD
9+
- SUB
10+
- SUBMOD
11+
- DIV
12+
- SDIV
13+
- MOD
14+
- SMOD
15+
- EXP
16+
- SIGNEXTEND
17+
"""
218

319
import operator
420
import random
@@ -16,15 +32,6 @@
1632

1733
from tests.benchmark.compute.helpers import DEFAULT_BINOP_ARGS, make_dup, neg
1834

19-
# Arithmetic instructions:
20-
# ADD, ADDMOD
21-
# SUB, SUBMOD
22-
# MUL, MULMOD
23-
# DIV, SDIV
24-
# MOD, SMOD
25-
# EXP
26-
# SIGNEXTEND
27-
2835

2936
@pytest.mark.parametrize(
3037
"opcode,opcode_args",

tests/benchmark/compute/instruction/test_bitwise.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
"""Benchmark bitwise instructions."""
1+
"""
2+
Benchmark bitwise instructions.
3+
4+
Supported Opcodes:
5+
- AND
6+
- OR
7+
- XOR
8+
- NOT
9+
- BYTE
10+
- SHL
11+
- SHR
12+
- SAR
13+
- CLZ
14+
"""
215

316
import random
417
from typing import Callable
@@ -22,9 +35,6 @@
2235
shr,
2336
)
2437

25-
# Bitwise instructions:
26-
# AND, OR, XOR, NOT, BYTE, SHL, SHR, SAR, CLZ
27-
2838

2939
@pytest.mark.parametrize(
3040
"opcode,opcode_args",

tests/benchmark/compute/instruction/test_block_context.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
"""Benchmark block context instructions."""
1+
"""
2+
Benchmark block context instructions.
3+
4+
Supported Opcodes:
5+
- BLOCKHASH
6+
- COINBASE
7+
- TIMESTAMP
8+
- NUMBER
9+
- PREVRANDAO
10+
- GASLIMIT
11+
- CHAINID
12+
- BASEFEE
13+
- BLOBBASEFEE
14+
"""
215

316
import pytest
417
from execution_testing import (
@@ -8,10 +21,6 @@
821
Op,
922
)
1023

11-
# Block context instructions:
12-
# BLOCKHASH, COINBASE, TIMESTAMP, NUMBER, PREVRANDAO, GASLIMIT, CHAINID,
13-
# BASEFEE, BLOBBASEFEE
14-
1524

1625
@pytest.mark.parametrize(
1726
"opcode",

tests/benchmark/compute/instruction/test_call_context.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
"""Benchmark call frame context instructions."""
1+
"""
2+
Benchmark call frame context instructions.
3+
4+
Supported Opcodes:
5+
- ADDRESS
6+
- CALLER
7+
- CALLVALUE
8+
- CALLDATASIZE
9+
- CALLDATACOPY
10+
- CALLDATALOAD
11+
- RETURNDATASIZE
12+
- RETURNDATACOPY
13+
"""
214

315
import pytest
416
from execution_testing import (

tests/benchmark/compute/instruction/test_comparison.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
"""Benchmark comparison instructions."""
1+
"""
2+
Benchmark comparison instructions.
3+
4+
Supported Opcodes:
5+
- LT
6+
- SLT
7+
- GT
8+
- SGT
9+
- EQ
10+
- ISZERO
11+
"""
212

313
import pytest
414
from execution_testing import (
@@ -7,9 +17,6 @@
717
Op,
818
)
919

10-
# Comparison instructions:
11-
# LT, SLT, GT, SGT, EQ, ISZERO
12-
1320

1421
@pytest.mark.parametrize(
1522
"opcode,opcode_args",

tests/benchmark/compute/instruction/test_control_flow.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
"""Benchmark control flow instructions."""
1+
"""
2+
Benchmark control flow instructions.
3+
4+
Supported Opcodes:
5+
- STOP
6+
- JUMP
7+
- JUMPI
8+
- PC
9+
- GAS
10+
- JUMPDEST
11+
"""
212

313
from execution_testing import (
414
Alloc,

tests/benchmark/compute/instruction/test_keccak.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
"""Benchmark keccak instructions."""
1+
"""
2+
Benchmark keccak instructions.
3+
4+
Supported Opcodes:
5+
- KECCAK256
6+
"""
27

38
import math
49

@@ -9,9 +14,6 @@
914
Op,
1015
)
1116

12-
# Keccak instructions:
13-
# KECCAK256
14-
1517
KECCAK_RATE = 136
1618

1719

tests/benchmark/compute/instruction/test_log.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
"""Benchmark log instructions."""
1+
"""
2+
Benchmark log instructions.
3+
4+
Supported Opcodes:
5+
- LOG0
6+
- LOG1
7+
- LOG2
8+
- LOG3
9+
- LOG4
10+
"""
211

312
import pytest
413
from execution_testing import (
@@ -8,9 +17,6 @@
817
Op,
918
)
1019

11-
# Log instructions:
12-
# LOG0, LOG1, LOG2, LOG3, LOG4
13-
1420

1521
@pytest.mark.parametrize(
1622
"opcode",

tests/benchmark/compute/instruction/test_memory.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
"""Benchmark memory instructions."""
1+
"""
2+
Benchmark memory instructions.
3+
4+
Supported Opcodes:
5+
- MSTORE
6+
- MSTORE8
7+
- MLOAD
8+
- MSIZE
9+
- MCOPY
10+
"""
211

312
import pytest
413
from execution_testing import (
@@ -9,9 +18,6 @@
918
Op,
1019
)
1120

12-
# Memory instructions:
13-
# MSTORE, MSTORE8, MLOAD, MSIZE, MCOPY
14-
1521

1622
@pytest.mark.parametrize("mem_size", [0, 1, 1_000, 100_000, 1_000_000])
1723
def test_msize(

0 commit comments

Comments
 (0)