-
Notifications
You must be signed in to change notification settings - Fork 45
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
Conversation
…pto into phklive-consistent-ci
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.
Looks good! Thank you! I left some small comments inline.
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// - 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 |
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.
"The suffix_s .." on line 22 should actually be at the start of the paragraph on line 25.
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// - 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 |
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.
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).
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// - 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. |
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.
"Notice that carry_mask..." should not be with bullet point iii
but is a separate paragraph.
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// 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 |
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.
"When performing a chain ..." should be a beginning of a new paragraph.
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.
Looks good! Thank you. I left a few doc formatting-related comments inline. Once these are addressed, we can merge.
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// 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 |
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.
This still doesn't seem to be formatted correctly.
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// 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. |
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.
These two sentences should be one paragraph.
src/hash/rescue/arch/x86_64_avx2.rs
Outdated
// << 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 |
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.
This is not formatted correctly.
|
In this PR I propose the standardisation of the the
Makefile
andCI
across different Miden repositories.Closes: #322