Skip to content

Commit

Permalink
AVX2: Fix documentation of sign in basemul
Browse files Browse the repository at this point in the history
Signed-off-by: Hanno Becker <[email protected]>
  • Loading branch information
hanno-becker committed Jan 28, 2025
1 parent c216bf9 commit e61427e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mlkem/native/x86_64/src/basemul.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ vpmullw %ymm7,%ymm12,%ymm7 # b1c1.lo
vmovdqa (32*\off+ 0)*2(%r8),%ymm8 # d0z
vpmulhw %ymm8,%ymm2,%ymm2 # b0d0z.hi
vpmullw %ymm8,%ymm10,%ymm10 # b0d0z.lo
vmovdqa (32*\off+16)*2(%r8),%ymm8 # d1z
vpmulhw %ymm8,%ymm4,%ymm4 # b1d1z.hi
vpmullw %ymm8,%ymm12,%ymm12 # b1d1z.lo
vmovdqa (32*\off+16)*2(%r8),%ymm8 # -d1z
vpmulhw %ymm8,%ymm4,%ymm4 # -b1d1z.hi
vpmullw %ymm8,%ymm12,%ymm12 # -b1d1z.lo

/* Compute 2nd high multiplication in Montgomery multiplication */
vmovdqa AVX2_BACKEND_DATA_OFFSET_16XQ*2(%rcx),%ymm8
Expand All @@ -84,10 +84,11 @@ vpsubw %ymm10,%ymm2,%ymm10 # b0d0
vpsubw %ymm6,%ymm15,%ymm6 # a1c1
vpsubw %ymm11,%ymm3,%ymm11 # a1d1
vpsubw %ymm7,%ymm0,%ymm7 # b1c1
vpsubw %ymm12,%ymm4,%ymm12 # b1d1
vpsubw %ymm12,%ymm4,%ymm12 # -b1d1z

vpaddw %ymm5,%ymm9,%ymm9
vpaddw %ymm7,%ymm11,%ymm11
/* Note the different sign here, cancelling the sign in -b1d1z */
vpsubw %ymm13,%ymm10,%ymm13
vpsubw %ymm12,%ymm6,%ymm6

Expand Down

0 comments on commit e61427e

Please sign in to comment.