Skip to content

Commit 73f992a

Browse files
committed
Remove 2 dead instruction from AArch64 back-end poly_tomont()
1. Remove 2 dead instructions. 2. These appear outside the inner-loop of poly_tomont(), so do NOT re-apply SLOTHY to minimize the difference in code going into production. 3. Re-autogen all files 4. Update HOL-Light bytecode for poly_tomont() 5. Re-check HOL-Light proof of this function. Signed-off-by: Rod Chapman <rodchap@amazon.com>
1 parent 8dae40b commit 73f992a

5 files changed

Lines changed: 0 additions & 16 deletions

File tree

dev/aarch64_clean/src/poly_tomont_asm.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
factor .req v2
4444
factor_t .req v3
4545
modulus .req v4
46-
modulus_twisted .req v5
4746

4847
tmp0 .req v6
4948

@@ -55,9 +54,6 @@ MLK_ASM_FN_SYMBOL(poly_tomont_asm)
5554
mov wtmp, #3329 // ML-KEM modulus
5655
dup modulus.8h, wtmp
5756

58-
mov wtmp, #20159 // Barrett twist of 1 wrt 2^27
59-
dup modulus_twisted.8h, wtmp
60-
6157
mov wtmp, #-1044 // 2^16 % 3329
6258
dup factor.8h, wtmp
6359

@@ -100,7 +96,6 @@ poly_tomont_loop:
10096
.unreq factor
10197
.unreq factor_t
10298
.unreq modulus
103-
.unreq modulus_twisted
10499

105100
.unreq tmp0
106101

dev/aarch64_opt/src/poly_tomont_asm.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
factor .req v2
4343
factor_t .req v3
4444
modulus .req v4
45-
modulus_twisted .req v5
4645

4746
tmp0 .req v6
4847

@@ -54,9 +53,6 @@ MLK_ASM_FN_SYMBOL(poly_tomont_asm)
5453
mov wtmp, #3329 // ML-KEM modulus
5554
dup modulus.8h, wtmp
5655

57-
mov wtmp, #20159 // Barrett twist of 1 wrt 2^27
58-
dup modulus_twisted.8h, wtmp
59-
6056
mov wtmp, #-1044 // 2^16 % 3329
6157
dup factor.8h, wtmp
6258

@@ -217,7 +213,6 @@ poly_tomont_loop:
217213
.unreq factor
218214
.unreq factor_t
219215
.unreq modulus
220-
.unreq modulus_twisted
221216

222217
.unreq tmp0
223218

mlkem/src/native/aarch64/src/poly_tomont_asm.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ MLK_ASM_FN_SYMBOL(poly_tomont_asm)
3434
.cfi_startproc
3535
mov w2, #0xd01 // =3329
3636
dup v4.8h, w2
37-
mov w2, #0x4ebf // =20159
38-
dup v5.8h, w2
3937
mov w2, #-0x414 // =-1044
4038
dup v2.8h, w2
4139
mov w2, #-0x2824 // =-10276

proofs/hol_light/aarch64/mlkem/mlkem_poly_tomont.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ PQCP_MLKEM_NATIVE_MLKEM768_poly_tomont_asm:
3737
.cfi_startproc
3838
mov w2, #0xd01 // =3329
3939
dup v4.8h, w2
40-
mov w2, #0x4ebf // =20159
41-
dup v5.8h, w2
4240
mov w2, #-0x414 // =-1044
4341
dup v2.8h, w2
4442
mov w2, #-0x2824 // =-10276

proofs/hol_light/aarch64/proofs/mlkem_poly_tomont.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ let poly_tomont_asm_mc = define_assert_from_elf
1818
[
1919
0x5281a022; (* arm_MOV W2 (rvalue (word 3329)) *)
2020
0x4e020c44; (* arm_DUP_GEN Q4 X2 16 128 *)
21-
0x5289d7e2; (* arm_MOV W2 (rvalue (word 20159)) *)
22-
0x4e020c45; (* arm_DUP_GEN Q5 X2 16 128 *)
2321
0x12808262; (* arm_MOVN W2 (word 1043) 0 *)
2422
0x4e020c42; (* arm_DUP_GEN Q2 X2 16 128 *)
2523
0x12850462; (* arm_MOVN W2 (word 10275) 0 *)

0 commit comments

Comments
 (0)