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

fix: update int division optimization #1928

Merged
merged 4 commits into from
Jul 18, 2023
Merged

fix: update int division optimization #1928

merged 4 commits into from
Jul 18, 2023

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jul 13, 2023

Description

Problem*

Resolves #1923

Summary*

The simplification for integer division in the ssa refactor was incorrect when operating on integer values. I've updated it to attempt to cast to u128 first.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher jfecher changed the title Fix int division optimization fix: update int division optimization Jul 13, 2023
@kevaundray
Copy link
Contributor

I think we want this for all operations, ie we check the type and if its a Field, then we do field addition, multiplication, addition, etc, but if the type is u8 for example, then we do addition modulo 256

@kevaundray kevaundray added this pull request to the merge queue Jul 17, 2023
Merged via the queue into master with commit fb872c6 Jul 18, 2023
@kevaundray kevaundray deleted the jf/fix-int-div branch July 18, 2023 01:23
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.

Unsigned integer division doesn't work with --experimental-ssa
2 participants