Skip to content

Commit e231577

Browse files
committed
Armv8.1-M: Remove unused r3 and r12 from push/pop in Keccak x4
Neither r3 nor r12 is callee-saved according to AAPCS. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent 4165ea0 commit e231577

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

dev/fips202/armv81m/src/keccak_f1600_x4_mve.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
c_parameter: const uint32_t *rc
2929
description: Keccak round constants in bit-interleaved form (24 pairs of 32-bit words)
3030
Stack:
31-
bytes: 236
32-
description: register preservation (44) + SIMD registers (64) + temporary storage (128)
31+
bytes: 228
32+
description: register preservation (36) + SIMD registers (64) + temporary storage (128)
3333
*/
3434

3535
// ---------------------------------------------------------------------------
@@ -460,7 +460,7 @@ qA20_l .req q2
460460
.global MLK_ASM_NAMESPACE(keccak_f1600_x4_mve_asm)
461461
MLK_ASM_FN_SYMBOL(keccak_f1600_x4_mve_asm)
462462

463-
push {r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
463+
push {r4,r5,r6,r7,r8,r9,r10,r11,lr}
464464
vpush {d8-d15}
465465
sub sp, #8*16
466466

@@ -1626,7 +1626,7 @@ keccak_f1600_x4_mve_asm_roundend:
16261626
add sp, #8*16
16271627

16281628
vpop {d8-d15}
1629-
ldmia.w sp!, {r3,r4,r5,r6,r7,r8,r9,r10,r11,r12, pc}
1629+
ldmia.w sp!, {r4,r5,r6,r7,r8,r9,r10,r11, pc}
16301630

16311631
/****************** REGISTER DEALLOCATIONS *******************/
16321632
.unreq qA00_h

mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
c_parameter: const uint32_t *rc
2929
description: Keccak round constants in bit-interleaved form (24 pairs of 32-bit words)
3030
Stack:
31-
bytes: 236
32-
description: register preservation (44) + SIMD registers (64) + temporary storage (128)
31+
bytes: 228
32+
description: register preservation (36) + SIMD registers (64) + temporary storage (128)
3333
*/
3434

3535
// ---------------------------------------------------------------------------
@@ -79,7 +79,7 @@
7979
.global MLK_ASM_NAMESPACE(keccak_f1600_x4_mve_asm)
8080
MLK_ASM_FN_SYMBOL(keccak_f1600_x4_mve_asm)
8181

82-
push.w {r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, lr}
82+
push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
8383
vpush {d8, d9, d10, d11, d12, d13, d14, d15}
8484
sub sp, #0x80
8585
mov r6, r2
@@ -659,7 +659,7 @@ keccak_f1600_x4_mve_asm_roundend_pre:
659659
keccak_f1600_x4_mve_asm_roundend:
660660
add sp, #0x80
661661
vpop {d8, d9, d10, d11, d12, d13, d14, d15}
662-
pop.w {r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, pc}
662+
pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
663663
nop
664664

665665
MLK_ASM_FN_SIZE(keccak_f1600_x4_mve_asm)

0 commit comments

Comments
 (0)