Skip to content

feat(vm): implement TIP-7939 CLZ opcode#6656

Open
yanghang8612 wants to merge 1 commit intotronprotocol:developfrom
yanghang8612:implement-tip-7939
Open

feat(vm): implement TIP-7939 CLZ opcode#6656
yanghang8612 wants to merge 1 commit intotronprotocol:developfrom
yanghang8612:implement-tip-7939

Conversation

@yanghang8612
Copy link
Copy Markdown
Collaborator

Summary

Implement TIP-7939 CLZ opcode (0x1e), gated behind the existing allowTvmOsaka flag.

  • New opcode: pops 1 value, pushes the number of leading zero bits (256 if zero)
  • Gas cost: 5 (LOW_TIER, matching MUL)
  • Added TRON_V1_5 version with appendOsakaOperations to support Osaka opcodes
  • Test cases cover all TIP test vectors and energy cost verification

Related: tronprotocol/tips#838

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants