Skip to content

LibraryScaling2025Design paperCorpus record

Count leading zeros (CLZ) opcode

EIP 7939. Vectorized , Georgios Konstantopoulos , Jochem Brouwer , Ben Adams , Giulio Rebuffo.

EIP 7939, Count leading zeros (CLZ) opcode. Introduce a new opcode, CLZ(x), which pops x from the stack and pushes the number of leading zero bits in x to the stack.

Status in the source: Final. A reading of the public specification, not a copy of it and not a certification.

Count leading zeros (CLZ) opcode is worth reading for the rule it actually adds: Introduce a new opcode, CLZ(x), which pops x from the stack and pushes the number of leading zero bits in x to the stack.
Evidence
Primary paper
Re-measured
No
Assumptions
3
Records linked
4

Code

Source, repository, and what is actually hosted

  • EIP 7939https://eips.ethereum.org/EIPS/eip-7939
  • The source URL is not a GitHub repository. No code remote is invented.
  • Full text is not mirrored. Public availability is not a licence to copy the file onto this site.
  • Add to a reading list

01 Claim ledger

What the paper is allowed to say

Each row is a sentence already in the study. The status is the same on every row: a model claim, not a live measurement.

  1. Claim 01 · Paper model

    The rule

    Introduce a new opcode, CLZ(x), which pops x from the stack and pushes the number of leading zero bits in x to the stack.

  2. Claim 02 · Paper model

    What was already failing

    An underpriced or ambiguous EVM rule is not a feature. It is a block that takes longer than the gas limit claimed, or a client that disagrees about the result.

  3. Claim 03 · Paper model

    What the number does not mean

    The source marks this final. That is a statement about the text, not a promise that every wallet or node has shipped it.

  4. Claim 04 · Paper model

    What a builder should be able to point at

    An implementation either constrains CLZ, RISC, ARM or it is a different design.

02 Three cuts

Observation, model, falsifier

A desk does not stop at the summary. Each claim is cut three ways, using only this study's own assumptions and checks. Nothing here is a new figure.

  1. 01 The rule

    Observation

    What the study says

    Introduce a new opcode, CLZ(x), which pops x from the stack and pushes the number of leading zero bits in x to the stack.

    Model

    What has to hold

    Constants in the text can be superseded by a later fork. Cite the EIP number and the fork you mean.

    Falsifier

    What would retire it

    What does Count leading zeros (CLZ) opcode charge, reject, or redefine on the first touch versus a later one?

  2. 02 What was already failing

    Observation

    What the study says

    An underpriced or ambiguous EVM rule is not a feature. It is a block that takes longer than the gas limit claimed, or a client that disagrees about the result.

    Model

    What has to hold

    The object that has to change is CLZ, RISC, ARM. A neighbouring document with a similar name is not this one.

    Falsifier

    What would retire it

    Can you point at the object in a client: CLZ, RISC, ARM?

  3. 03 What the number does not mean

    Observation

    What the study says

    The source marks this final. That is a statement about the text, not a promise that every wallet or node has shipped it.

    Model

    What has to hold

    You are implementing EIP 7939 at the status the text itself states: Final.

    Falsifier

    What would retire it

    Can you point at the object in a client: CLZ, RISC, ARM?

  4. 04 What a builder should be able to point at

    Observation

    What the study says

    An implementation either constrains CLZ, RISC, ARM or it is a different design.

    Model

    What has to hold

    You are implementing EIP 7939 at the status the text itself states: Final.

    Falsifier

    What would retire it

    Can you point at the object in a client: CLZ, RISC, ARM?

03 Sequence

One action, as an operating tape

  1. 01Open EIP 7939 and read the status line before the examples.
  2. 02Write down the rule in one sentence. A fair version of that sentence is: Introduce a new opcode, CLZ(x), which pops x from the stack and pushes the number of leading zero bits in x to the stack.
  3. 03Name the object that changes: CLZ, RISC, ARM.
  4. 04Ask what an old client, an old contract, or an offline counterparty does. If the document is silent, the silence is part of the design.

04 Load-bearing

The argument, and where a pitch drops it

  1. What the text is allowed to settle

    The cut

    Ethereum Improvement Proposal 7939 can settle the shape of Count leading zeros (CLZ) opcode. It cannot settle whether a later client, a later fork, or a later wallet still does this.

    Why it carries weight

    If this cut is skipped, the paper's name is being used without the mechanism that makes the name mean anything.

    Where it is dropped

    A gas or opcode change is not a throughput benchmark. It is a relative price and a validity rule.

  2. What this page will not pretend

    The cut

    There is no benchmark, no adoption number, and no claim that the mechanism is safe outside the assumptions written in the source.

    Why it carries weight

    If this cut is skipped, the paper's name is being used without the mechanism that makes the name mean anything.

    Where it is dropped

    A gas or opcode change is not a throughput benchmark. It is a relative price and a validity rule.

05 Register

What has to be true

  • Model · Not re-measured

    You are implementing EIP 7939 at the status the text itself states: Final.

  • Model · Not re-measured

    The object that has to change is CLZ, RISC, ARM. A neighbouring document with a similar name is not this one.

  • Model · Not re-measured

    Constants in the text can be superseded by a later fork. Cite the EIP number and the fork you mean.

06 Divergence

What happened after the paper

The source marks this final. That is a statement about the text, not a promise that every wallet or node has shipped it. Later documents can narrow, replace, or ignore this one. Cite the number you mean.

A later client, parameter set, or reward formula is a different object. Cite this paper for the mechanism. Cite a primary release for the network. This desk has not re-run the proof.

07 Pre-mortem

What to check before you use the idea

  1. 0 of 3 marked on this browser. A mark is a reading note, not a pass, a rating, or a recommendation.

08 Anatomy

The paper, in the order a builder needs

The problem it names

An underpriced or ambiguous EVM rule is not a feature. It is a block that takes longer than the gas limit claimed, or a client that disagrees about the result.

What the design proposes

  • Introduce a new opcode, CLZ(x), which pops x from the stack and pushes the number of leading zero bits in x to the stack.
  • Count leading zeros (CLZ) is a native opcode in many processor architectures (even in RISC architectures like ARM).
  • It is a basic building block used in math operations, byte operations, compression algorithms, data structures: - lnWad - powWad - lambertW0Wad - sqrt - cbrt - byte string comparisons - generalized calldata compression/decompression - bitmaps (for finding the next/previous set/unset bit) - post quantum signature schemes Adding a CLZ opcode will: - Lead to cheaper compute.

How the mechanism is specified

  • Taken from the specification, the next constraint is: Count leading zeros (CLZ) is a native opcode in many processor architectures (even in RISC architectures like ARM).
  • Locate CLZ, RISC, ARM in EIP 7939 and apply it to one transaction or call.
  • Then check the failure the class of rule always has: a node that did not upgrade, a reverted call, a replayed signature, or a peer that does not speak the message.

What this page does not treat as proven

  • A gas or opcode change is not a throughput benchmark. It is a relative price and a validity rule.
  • Constants in the text can be superseded by a later fork. Cite the EIP number and the fork you mean.
  • The source marks this final. That is a statement about the text, not a promise that every wallet or node has shipped it.

Why the desk still reads it

Use EIP 7939 when a pitch says 'Count leading zeros (CLZ) opcode' without saying whether the rule is consensus, policy, or an interface. The number is the citation. The pitch is not.

09 Lexicon

Terms, opened into the record

EIP 7939
The public text titled Count leading zeros (CLZ) opcode.
Final
The document's own label for how finished the text is. It is not a market fact.

10 Repository

Every linked record on this page

Underlined words open a page that already exists: a concept, a protocol profile, a failure record, or another paper. If a word is not underlined, this desk does not have a record for it.

This is Blockchain Lab's reading of a public design paper. It is not the paper, not a copy of it, and not an offer of tokens, equity, custody or a partnership. Later network behaviour can diverge from the text. Nothing here is investment, legal or technical advice.

Research status: Design paper. Last reviewed: 1 October 2026. This is a reading of a public paper, not investment, legal or security advice.