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

Consider removing Shl and Shr from SSA IR #1521

Closed
kevaundray opened this issue Jun 3, 2023 · 1 comment
Closed

Consider removing Shl and Shr from SSA IR #1521

kevaundray opened this issue Jun 3, 2023 · 1 comment
Assignees
Labels

Comments

@kevaundray
Copy link
Contributor

Problem

Shift left and Shift right are converted into multiplication or division by a power two. Unlike normal CPU architectures where shift left and shift right are efficient, it is not the case for the SNARK context.

Happy Case

We can convert the shifts into multiplications and divisions and add a pow binary operator.

The pow binary operator would allow us to do x^y. We can use it for shift left and shift right where x=2.

In ACIR gen we will still need to figure out how to handle the case where y is a witness. See #1478 and #1479 for more context.

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@guipublic
Copy link
Contributor

Closing as completed by #2072

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants