Skip to content

Commit f6a6793

Browse files
jakemasmkannwischer
authored andcommitted
x86_64: Consolidate AVX2 kernel doc into the YAML header
poly_caddq, poly_chknorm and polyz_unpack_{17,19} each carried a prose Name/Description/Arguments comment block in addition to the /*yaml*/ ABI header, duplicating the same information. Fold the descriptive text into a multi-line YAML Description field and drop the prose block, so the YAML header is the single source of truth, matching the convention used by the aarch64 kernels and the poly_decompose/poly_use_hint AVX2 routines. Comment-only change: the generated shipped and HOL-Light proof assembly is byte-identical (verified via objdump), so no proof bytecode changes. Signed-off-by: Jake Massimo <jakemas@amazon.com>
1 parent 4043742 commit f6a6793

12 files changed

Lines changed: 39 additions & 144 deletions

dev/x86_64/src/poly_caddq_avx2_asm.S

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_poly_caddq_avx2_asm
23-
*
24-
* Description: For all coefficients of in/out polynomial add Q if
25-
* coefficient is negative.
26-
*
27-
* Arguments: - int32_t *r: pointer to input/output polynomial
28-
**************************************************/
29-
3021
/*yaml
3122
Name: poly_caddq_avx2_asm
32-
Description: x86_64 AVX2 conditional addition of q to each coefficient
23+
Description: x86_64 AVX2 conditional addition of q to each coefficient.
24+
For all coefficients of the in/out polynomial, add Q if the coefficient
25+
is negative.
3326
Signature: void mld_poly_caddq_avx2_asm(int32_t *r)
3427
ABI:
3528
Architecture: x86_64

dev/x86_64/src/poly_chknorm_avx2_asm.S

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,12 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_poly_chknorm_avx2_asm
23-
*
24-
* Description: Check infinity norm of polynomial against given bound.
25-
* Returns 0 if norm is strictly smaller than B; otherwise
26-
* returns 1.
27-
*
28-
* Arguments: - const int32_t *a: pointer to input polynomial
29-
* - int32_t B: bound
30-
*
31-
* Returns: - 1 if any |coefficient| >= B, 0 otherwise.
32-
**************************************************/
33-
3421
/*yaml
3522
Name: poly_chknorm_avx2_asm
36-
Description: x86_64 AVX2 infinity-norm bound check on polynomial coefficients
23+
Description: x86_64 AVX2 infinity-norm bound check on polynomial coefficients.
24+
Check the infinity norm of the polynomial against the given bound B.
25+
Returns 0 if the norm is strictly smaller than B; otherwise returns 1
26+
(i.e. returns 1 if any |coefficient| >= B, 0 otherwise).
3727
Signature: int mld_poly_chknorm_avx2_asm(const int32_t *a, int32_t B)
3828
ABI:
3929
Architecture: x86_64

dev/x86_64/src/polyz_unpack_17_avx2_asm.S

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_polyz_unpack_17_avx2_asm
23-
*
24-
* Description: Unpack polynomial z with 18-bit packed coefficients
25-
* (GAMMA1 = 2^17). Maps packed [0, 2^18-1] to signed
26-
* [-(2^17-1), 2^17] via GAMMA1 - x.
27-
*
28-
* Arguments: - int32_t *r: pointer to output polynomial (1024 bytes)
29-
* - const uint8_t *a: pointer to packed input (576 bytes)
30-
**************************************************/
31-
3221
/*yaml
3322
Name: polyz_unpack_17_avx2_asm
34-
Description: x86_64 AVX2 unpacking of 17-bit packed coefficients
23+
Description: x86_64 AVX2 unpacking of 17-bit packed coefficients.
24+
Unpack polynomial z with 18-bit packed coefficients (GAMMA1 = 2^17),
25+
mapping packed [0, 2^18-1] to signed [-(2^17-1), 2^17] via GAMMA1 - x.
3526
Signature: void mld_polyz_unpack_17_avx2_asm(int32_t *r, const uint8_t *a)
3627
ABI:
3728
Architecture: x86_64

dev/x86_64/src/polyz_unpack_19_avx2_asm.S

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_polyz_unpack_19_avx2_asm
23-
*
24-
* Description: Unpack polynomial z with 20-bit packed coefficients
25-
* (GAMMA1 = 2^19). Maps packed [0, 2^20-1] to signed
26-
* [-(2^19-1), 2^19] via GAMMA1 - x.
27-
*
28-
* Arguments: - int32_t *r: pointer to output polynomial (1024 bytes)
29-
* - const uint8_t *a: pointer to packed input (640 bytes)
30-
**************************************************/
31-
3221
/*yaml
3322
Name: polyz_unpack_19_avx2_asm
34-
Description: x86_64 AVX2 unpacking of 19-bit packed coefficients
23+
Description: x86_64 AVX2 unpacking of 19-bit packed coefficients.
24+
Unpack polynomial z with 20-bit packed coefficients (GAMMA1 = 2^19),
25+
mapping packed [0, 2^20-1] to signed [-(2^19-1), 2^19] via GAMMA1 - x.
3526
Signature: void mld_polyz_unpack_19_avx2_asm(int32_t *r, const uint8_t *a)
3627
ABI:
3728
Architecture: x86_64

mldsa/src/native/x86_64/src/poly_caddq_avx2_asm.S

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_poly_caddq_avx2_asm
23-
*
24-
* Description: For all coefficients of in/out polynomial add Q if
25-
* coefficient is negative.
26-
*
27-
* Arguments: - int32_t *r: pointer to input/output polynomial
28-
**************************************************/
29-
3021
/*yaml
3122
Name: poly_caddq_avx2_asm
32-
Description: x86_64 AVX2 conditional addition of q to each coefficient
23+
Description: x86_64 AVX2 conditional addition of q to each coefficient.
24+
For all coefficients of the in/out polynomial, add Q if the coefficient
25+
is negative.
3326
Signature: void mld_poly_caddq_avx2_asm(int32_t *r)
3427
ABI:
3528
Architecture: x86_64

mldsa/src/native/x86_64/src/poly_chknorm_avx2_asm.S

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,12 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_poly_chknorm_avx2_asm
23-
*
24-
* Description: Check infinity norm of polynomial against given bound.
25-
* Returns 0 if norm is strictly smaller than B; otherwise
26-
* returns 1.
27-
*
28-
* Arguments: - const int32_t *a: pointer to input polynomial
29-
* - int32_t B: bound
30-
*
31-
* Returns: - 1 if any |coefficient| >= B, 0 otherwise.
32-
**************************************************/
33-
3421
/*yaml
3522
Name: poly_chknorm_avx2_asm
36-
Description: x86_64 AVX2 infinity-norm bound check on polynomial coefficients
23+
Description: x86_64 AVX2 infinity-norm bound check on polynomial coefficients.
24+
Check the infinity norm of the polynomial against the given bound B.
25+
Returns 0 if the norm is strictly smaller than B; otherwise returns 1
26+
(i.e. returns 1 if any |coefficient| >= B, 0 otherwise).
3727
Signature: int mld_poly_chknorm_avx2_asm(const int32_t *a, int32_t B)
3828
ABI:
3929
Architecture: x86_64

mldsa/src/native/x86_64/src/polyz_unpack_17_avx2_asm.S

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_polyz_unpack_17_avx2_asm
23-
*
24-
* Description: Unpack polynomial z with 18-bit packed coefficients
25-
* (GAMMA1 = 2^17). Maps packed [0, 2^18-1] to signed
26-
* [-(2^17-1), 2^17] via GAMMA1 - x.
27-
*
28-
* Arguments: - int32_t *r: pointer to output polynomial (1024 bytes)
29-
* - const uint8_t *a: pointer to packed input (576 bytes)
30-
**************************************************/
31-
3221
/*yaml
3322
Name: polyz_unpack_17_avx2_asm
34-
Description: x86_64 AVX2 unpacking of 17-bit packed coefficients
23+
Description: x86_64 AVX2 unpacking of 17-bit packed coefficients.
24+
Unpack polynomial z with 18-bit packed coefficients (GAMMA1 = 2^17),
25+
mapping packed [0, 2^18-1] to signed [-(2^17-1), 2^17] via GAMMA1 - x.
3526
Signature: void mld_polyz_unpack_17_avx2_asm(int32_t *r, const uint8_t *a)
3627
ABI:
3728
Architecture: x86_64

mldsa/src/native/x86_64/src/polyz_unpack_19_avx2_asm.S

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_polyz_unpack_19_avx2_asm
23-
*
24-
* Description: Unpack polynomial z with 20-bit packed coefficients
25-
* (GAMMA1 = 2^19). Maps packed [0, 2^20-1] to signed
26-
* [-(2^19-1), 2^19] via GAMMA1 - x.
27-
*
28-
* Arguments: - int32_t *r: pointer to output polynomial (1024 bytes)
29-
* - const uint8_t *a: pointer to packed input (640 bytes)
30-
**************************************************/
31-
3221
/*yaml
3322
Name: polyz_unpack_19_avx2_asm
34-
Description: x86_64 AVX2 unpacking of 19-bit packed coefficients
23+
Description: x86_64 AVX2 unpacking of 19-bit packed coefficients.
24+
Unpack polynomial z with 20-bit packed coefficients (GAMMA1 = 2^19),
25+
mapping packed [0, 2^20-1] to signed [-(2^19-1), 2^19] via GAMMA1 - x.
3526
Signature: void mld_polyz_unpack_19_avx2_asm(int32_t *r, const uint8_t *a)
3627
ABI:
3728
Architecture: x86_64

proofs/hol_light/x86_64/mldsa/poly_caddq_avx2_asm.S

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_poly_caddq_avx2_asm
23-
*
24-
* Description: For all coefficients of in/out polynomial add Q if
25-
* coefficient is negative.
26-
*
27-
* Arguments: - int32_t *r: pointer to input/output polynomial
28-
**************************************************/
29-
3021
/*yaml
3122
Name: poly_caddq_avx2_asm
32-
Description: x86_64 AVX2 conditional addition of q to each coefficient
23+
Description: x86_64 AVX2 conditional addition of q to each coefficient.
24+
For all coefficients of the in/out polynomial, add Q if the coefficient
25+
is negative.
3326
Signature: void mld_poly_caddq_avx2_asm(int32_t *r)
3427
ABI:
3528
Architecture: x86_64

proofs/hol_light/x86_64/mldsa/poly_chknorm_avx2_asm.S

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,12 @@
1818
*/
1919

2020

21-
/*************************************************
22-
* Name: mld_poly_chknorm_avx2_asm
23-
*
24-
* Description: Check infinity norm of polynomial against given bound.
25-
* Returns 0 if norm is strictly smaller than B; otherwise
26-
* returns 1.
27-
*
28-
* Arguments: - const int32_t *a: pointer to input polynomial
29-
* - int32_t B: bound
30-
*
31-
* Returns: - 1 if any |coefficient| >= B, 0 otherwise.
32-
**************************************************/
33-
3421
/*yaml
3522
Name: poly_chknorm_avx2_asm
36-
Description: x86_64 AVX2 infinity-norm bound check on polynomial coefficients
23+
Description: x86_64 AVX2 infinity-norm bound check on polynomial coefficients.
24+
Check the infinity norm of the polynomial against the given bound B.
25+
Returns 0 if the norm is strictly smaller than B; otherwise returns 1
26+
(i.e. returns 1 if any |coefficient| >= B, 0 otherwise).
3727
Signature: int mld_poly_chknorm_avx2_asm(const int32_t *a, int32_t B)
3828
ABI:
3929
Architecture: x86_64

0 commit comments

Comments
 (0)