Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement 0x1C - SHR opcode #16

Closed
jobez opened this issue Feb 15, 2023 · 2 comments · Fixed by #237
Closed

feat: implement 0x1C - SHR opcode #16

jobez opened this issue Feb 15, 2023 · 2 comments · Fixed by #237
Assignees
Labels
enhancement New feature or request opcode Implementation of an opcode workshop Reserved / Dedicated for workshops

Comments

@jobez
Copy link
Contributor

jobez commented Feb 15, 2023


fork: Constantinople
group: Comparison & Bitwise Logic Operations

Index 1 is top of the stack. See PUSH.

Notes

Shift the bits towards the least significant one. The bits moved before the first one are discarded, the new bits are set to 0.

Stack input

  1. shift: number of bits to shift to the right.
  2. value: 32 bytes to shift.

Stack output

  1. value >> shift: the shifted value. If shift is bigger than 255, returns 0.

Examples

* Input Output * * Input Output
1 1 1 * 1 4 0xF
2 2 * 2 0xFF

Reproduce in playground.

Error cases

The state changes done by the current context are reverted in those cases:

  • Not enough values on the stack.
@jobez jobez added the enhancement New feature or request label Feb 15, 2023
@github-actions
Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Mar 18, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 25, 2023
@Eikix Eikix removed the stale label Jul 28, 2023
@Eikix Eikix reopened this Jul 28, 2023
@enitrat enitrat added the workshop Reserved / Dedicated for workshops label Aug 23, 2023
@kkrt-labs kkrt-labs unlocked this conversation Aug 23, 2023
@Eikix Eikix added the opcode Implementation of an opcode label Aug 23, 2023
@Eikix Eikix added this to the Kakarot Cairo Migration milestone Aug 29, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Kakarot on Starknet Aug 29, 2023
@khaeljy
Copy link
Contributor

khaeljy commented Aug 31, 2023

@Eikix Can I implement this?

@github-project-automation github-project-automation bot moved this from 🆕 Backlog to ✅ Done in Kakarot on Starknet Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request opcode Implementation of an opcode workshop Reserved / Dedicated for workshops
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants