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

Update Makefile and CI #323

Merged
merged 16 commits into from
Aug 22, 2024
Merged

Update Makefile and CI #323

merged 16 commits into from
Aug 22, 2024

Conversation

phklive
Copy link
Contributor

@phklive phklive commented Aug 16, 2024

In this PR I propose the standardisation of the the Makefile and CI across different Miden repositories.

Closes: #322

@phklive phklive requested a review from bobbinth August 17, 2024 00:33
@phklive phklive marked this pull request as ready for review August 17, 2024 00:34
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left some small comments inline.

@phklive phklive requested a review from bobbinth August 21, 2024 16:07
Comment on lines 22 to 25
// - v. res_hi = a_hi + b_hi - carry_mask The suffix _s denotes a value that has been
// shifted by 1 << 63.
//
// The result of addition is shifted if exactly one of the operands is shifted, as is the case on
Copy link
Contributor

Choose a reason for hiding this comment

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

"The suffix_s .." on line 22 should actually be at the start of the paragraph on line 25.

Comment on lines 18 to 22
// - i. a_lo_s = shift(a_lo)
// - ii. res_lo_s = a_lo_s + b_lo
// - iii. carry_mask = res_lo_s <s a_lo_s
// - iv. res_lo = shift(res_lo_s)
// - v. res_hi = a_hi + b_hi - carry_mask The suffix _s denotes a value that has been
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, and in the text block below. We can probably use just simple numbered list (i.e., no need for bullet-point list with internal numbering).

Comment on lines 11 to 12
// - iii. res_hi = a_hi + b_hi - carry_mask Notice that carry_mask is subtracted, not added.
// This is because AVX comparison instructions return -1 (all bits 1) for true and 0 for false.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Notice that carry_mask..." should not be with bullet point iii but is a separate paragraph.

// The result of addition is shifted if exactly one of the operands is shifted, as is the case on
// line ii. Line iii. performs a signed comparison res_lo_s <s a_lo_s on shifted values to
// emulate unsigned comparison res_lo <u a_lo on unshifted values. Finally, line iv. reverses the
// shift so the result can be returned. When performing a chain of calculations, we can often
Copy link
Contributor

Choose a reason for hiding this comment

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

"When performing a chain ..." should be a beginning of a new paragraph.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you. I left a few doc formatting-related comments inline. Once these are addressed, we can merge.

Comment on lines 7 to 9
// 1. AVX does not support addition with carry but 128-bit (2-word) addition can be easily emulated.
// The method recognizes that for a + b overflowed iff (a + b) < a: i. res_lo = a_lo + b_lo ii.
// carry_mask = res_lo < a_lo iii. res_hi = a_hi + b_hi - carry_mask
Copy link
Contributor

Choose a reason for hiding this comment

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

This still doesn't seem to be formatted correctly.

Comment on lines 11 to 13
// Notice that carry_mask is subtracted, not added.
//
// This is because AVX comparison instructions return -1 (all bits 1) for true and 0 for false.
Copy link
Contributor

Choose a reason for hiding this comment

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

These two sentences should be one paragraph.

Comment on lines 18 to 20
// << 63 to enable this trick. Addition with carry example: i. a_lo_s = shift(a_lo) ii. res_lo_s
// = a_lo_s + b_lo iii. carry_mask = res_lo_s <s a_lo_s iv. res_lo = shift(res_lo_s) v. res_hi =
// a_hi + b_hi - carry_mask
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not formatted correctly.

Copy link

@phklive phklive merged commit f4a9d5b into next Aug 22, 2024
12 checks passed
@phklive phklive deleted the phklive-consistent-ci branch August 22, 2024 15:22
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