Skip to content

Commit 75d06cd

Browse files
committed
SP Intel x64 ASM: fixes
Don't use RIP relative with XMM/YMM instructions. For MSVC asm, explicitly state type for pointer. For MSVC asm, don't use vmodvqu for saving XMM registers unless this is AVX2 code.
1 parent 38c7327 commit 75d06cd

2 files changed

Lines changed: 2975 additions & 2967 deletions

File tree

wolfcrypt/src/sp_x86_64_asm.S

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* sp_x86_64_asm.S */
22
/*
3-
* Copyright (C) 2006-2023 wolfSSL Inc.
3+
* Copyright (C) 2006-2024 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*
@@ -59047,15 +59047,23 @@ _sp_256_mod_inv_avx2_4:
5904759047
movq 8(%rsi), %r11
5904859048
movq 16(%rsi), %r12
5904959049
movq 24(%rsi), %r13
59050-
vmovupd 0+L_sp256_mod_inv_avx2_4_order(%rip), %ymm6
59051-
vmovupd 32+L_sp256_mod_inv_avx2_4_order(%rip), %ymm7
59052-
vmovupd 0+L_sp256_mod_inv_avx2_4_one(%rip), %ymm8
59053-
vmovupd 0+L_sp256_mod_inv_avx2_4_mask01111(%rip), %ymm9
59054-
vmovupd 0+L_sp256_mod_inv_avx2_4_all_one(%rip), %ymm10
59055-
vmovupd 0+L_sp256_mod_inv_avx2_4_down_one_dword(%rip), %ymm11
59056-
vmovupd 0+L_sp256_mod_inv_avx2_4_neg(%rip), %ymm12
59057-
vmovupd 0+L_sp256_mod_inv_avx2_4_up_one_dword(%rip), %ymm13
59058-
vmovupd 0+L_sp256_mod_inv_avx2_4_mask26(%rip), %ymm14
59050+
leaq L_sp256_mod_inv_avx2_4_order(%rip), %rbx
59051+
vmovupd (%rbx), %ymm6
59052+
vmovupd 32(%rbx), %ymm7
59053+
leaq L_sp256_mod_inv_avx2_4_one(%rip), %rbx
59054+
vmovupd (%rbx), %ymm8
59055+
leaq L_sp256_mod_inv_avx2_4_mask01111(%rip), %rbx
59056+
vmovupd (%rbx), %ymm9
59057+
leaq L_sp256_mod_inv_avx2_4_all_one(%rip), %rbx
59058+
vmovupd (%rbx), %ymm10
59059+
leaq L_sp256_mod_inv_avx2_4_down_one_dword(%rip), %rbx
59060+
vmovupd (%rbx), %ymm11
59061+
leaq L_sp256_mod_inv_avx2_4_neg(%rip), %rbx
59062+
vmovupd (%rbx), %ymm12
59063+
leaq L_sp256_mod_inv_avx2_4_up_one_dword(%rip), %rbx
59064+
vmovupd (%rbx), %ymm13
59065+
leaq L_sp256_mod_inv_avx2_4_mask26(%rip), %rbx
59066+
vmovupd (%rbx), %ymm14
5905959067
vpxor %xmm0, %xmm0, %xmm0
5906059068
vpxor %xmm1, %xmm1, %xmm1
5906159069
vmovdqu %ymm8, %ymm2

0 commit comments

Comments
 (0)