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: remove a bunch of unnecessary bytecode from unconstrained ops #50

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves

Summary*

This PR removes a bunch of unnecessary mutation from the unconstrained code to avoid needing to handle stores/loads and for mem2reg to need to try and remove them again.

Additional Context

PR Checklist*

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

@TomAFrench TomAFrench enabled auto-merge (squash) November 6, 2024 20:32

let sub_term = subtrahend_u60.limbs[i] + borrow_in;
let mut borrow = (sub_term > add_term) as u64;
result_u60.limbs[i] = borrow * TWO_POW_60 + add_term - sub_term;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good to me.

@TomAFrench
Copy link
Member Author

Can you approve?

@TomAFrench TomAFrench merged commit 08c4151 into main Nov 7, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Nov 6, 2024
@TomAFrench TomAFrench deleted the tf/remove-unnecessary-code branch November 7, 2024 14:14
TomAFrench added a commit that referenced this pull request Nov 8, 2024
* main:
  feat: remove generic parameter from the `BigNum` trait (#44)
  fix: fix broken tests in `runtime_bignum_test.nr` (#39)
  feat: remove a bunch of unnecessary bytecode from unconstrained ops (#50)
  fix: Fix barrett reduction bug (#51)
  feat: optimize brillig execution of `split_X_bits` functions (#47)
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