Skip to content

Commit

Permalink
Fixup add_all
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBF committed Jun 30, 2022
1 parent bc22ca9 commit 4c86307
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/crates/fp/src/limb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ pub(crate) const fn add<const P: u32>(limb_a: Limb, limb_b: Limb, coeff: u32) ->
/// when `P == 2`.
pub(crate) fn add_all<const P: u32>(lhs: &mut [Limb], rhs: &[Limb], c: u32) {
if P == 2 {
simd::add_simd(lhs, rhs, 0);
if c != 0 {
simd::add_simd(lhs, rhs, 0);
}
} else {
for (left, right) in lhs.iter_mut().zip(rhs) {
*left = add::<P>(*left, *right, c);
Expand Down

0 comments on commit 4c86307

Please sign in to comment.