-
Notifications
You must be signed in to change notification settings - Fork 530
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
Add int_range_pop_front libfunc. #6286
Conversation
8f9f142
to
a7707f6
Compare
73962f5
to
b3bf2e0
Compare
b3bf2e0
to
ac4d054
Compare
a7707f6
to
95ccbe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 10 files at r1, all commit messages.
Reviewable status: 7 of 10 files reviewed, 2 unresolved discussions (waiting on @liorgold2)
crates/cairo-lang-sierra-to-casm/src/invocations/range.rs
line 35 at r1 (raw file):
NonEmpty: const one = 1; let new_start = start + one;
Suggestion:
let new_start = start + one;
const one = 1;
tempvar is_non_empty = end - start;
jump NonEmpty if is_non_empty != 0;
crates/cairo-lang-sierra-to-casm/src/invocations/range.rs
line 43 at r1 (raw file):
("Fallthrough", &[&[new_start, end], &[start]], None), ("Failure", &[], Some(failure_handle)), ],
and change the signature - will require an enum.
(we may consider adding in core::internal::OptionReversed
just to help all the "upside-down" libfuncs)
Suggestion:
[
("Fallthrough", &[], None),
("NonEmpty", &[&[new_start, end], &[start]], Some(non_empty_handle)),
],
95ccbe1
to
be1999d
Compare
ac4d054
to
bbc7800
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 6 files at r2, all commit messages.
Reviewable status: 4 of 10 files reviewed, 4 unresolved discussions (waiting on @liorgold2)
crates/cairo-lang-sierra/src/extensions/core.rs
line 142 at r2 (raw file):
Pedersen(PedersenLibfunc), Poseidon(PoseidonLibfunc), Range(IntRangeLibfunc),
Int at the variant as well
crates/cairo-lang-sierra/src/extensions/modules/range.rs
line 91 at r2 (raw file):
args: &[GenericArg], ) -> Result<LibfuncSignature, SpecializationError> { let ty = args_as_single_type(args)?;
Probably need to be blocked for large ranges (over 2 pow 128 size)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 10 files reviewed, 4 unresolved discussions (waiting on @orizi)
crates/cairo-lang-sierra/src/extensions/modules/range.rs
line 91 at r2 (raw file):
Previously, orizi wrote…
Probably need to be blocked for large ranges (over 2 pow 128 size)
Not this libfunc, just the construction of Range
.
be1999d
to
c392a11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 11 files reviewed, 4 unresolved discussions (waiting on @Arcticae, @Draggu, @mkaput, @orizi, and @piotmag769)
crates/cairo-lang-sierra/src/extensions/core.rs
line 142 at r2 (raw file):
Previously, orizi wrote…
Int at the variant as well
Done.
crates/cairo-lang-sierra-to-casm/src/invocations/range.rs
line 35 at r1 (raw file):
NonEmpty: const one = 1; let new_start = start + one;
Done.
crates/cairo-lang-sierra-to-casm/src/invocations/range.rs
line 43 at r1 (raw file):
Previously, orizi wrote…
and change the signature - will require an enum.
(we may consider adding incore::internal::OptionReversed
just to help all the "upside-down" libfuncs)
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 6 files at r2.
Reviewable status: 2 of 11 files reviewed, 3 unresolved discussions (waiting on @Arcticae, @Draggu, @mkaput, and @piotmag769)
commit-id:12946952
c392a11
to
d798244
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Arcticae, @Draggu, @mkaput, and @piotmag769)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Arcticae, @Draggu, @liorgold2, @mkaput, and @piotmag769)
crates/cairo-lang-sierra-to-casm/src/invocations/range.rs
line 42 at r4 (raw file):
("NonEmpty", &[&[new_start, end], &[start]], Some(non_empty_handle)), ], Default::default(),
maybe we should return all options?
- no need for multiple checks for different pops.
- less libfuncs.
Suggestion:
};
casm_build_extend! {casm_builder,
const one = 1;
let new_start = start + one;
let new_end = end - one;
tempvar is_non_empty = end - start;
jump NonEmpty if is_non_empty != 0;
};
let non_empty_handle = get_non_fallthrough_statement_id(&builder);
Ok(builder.build_from_casm_builder(
casm_builder,
[
("Fallthrough", &[], None),
("NonEmpty", &[&[new_start, end], &[start, new_end], &[start], &[new_end]], Some(non_empty_handle)),
],
Default::default(),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Arcticae, @Draggu, @mkaput, @orizi, and @piotmag769)
crates/cairo-lang-sierra-to-casm/src/invocations/range.rs
line 42 at r4 (raw file):
Previously, orizi wrote…
maybe we should return all options?
- no need for multiple checks for different pops.
- less libfuncs.
Makes sense, but I'll do it in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Arcticae, @Draggu, @mkaput, and @piotmag769)
Stack:
This change is