From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
x86@kernel.org, Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH 8/8] lib/crypto: x86/sha512: Use local labels for data
Date: Sat, 21 Nov 2026 18:20:30 -0800 [thread overview]
Message-ID: <20261122022030.296468-9-ebiggers@kernel.org> (raw)
In-Reply-To: <20261122022030.296468-1-ebiggers@kernel.org>
Prefix XMM_QWORD_BSWAP, XMM_QWORD_ROR8, and K512 with ".L_" to make them
local labels and avoid emitting extra symbol table entries.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
lib/crypto/x86/sha512-ssse3-asm.S | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/crypto/x86/sha512-ssse3-asm.S b/lib/crypto/x86/sha512-ssse3-asm.S
index 62f1f5109f629..42375adde01ef 100644
--- a/lib/crypto/x86/sha512-ssse3-asm.S
+++ b/lib/crypto/x86/sha512-ssse3-asm.S
@@ -71,7 +71,7 @@ g_64 = %r15
h_64 = %rbx
tmp0 = %rax
# Used in the rounds 14-77 loop, while digest and msglen are spilled
-kptr = %rdi # Pointer to K512[72]
+kptr = %rdi # Pointer to .L_K512[72]
toff = %rdx # 8*(t - 80), where W[t] is the first QWORD scheduled in the iteration.
XWK = %xmm5 # {W[t]+K[t], W[t+1]+K[t+1]} for the next two rounds
@@ -85,8 +85,8 @@ XW4 = %xmm10
XW5 = %xmm11
XW6 = %xmm12
XW7 = %xmm13
-XBSWAP = %xmm14 # XMM_QWORD_BSWAP
-XROR8 = %xmm15 # XMM_QWORD_ROR8
+XBSWAP = %xmm14 # .L_XMM_QWORD_BSWAP
+XROR8 = %xmm15 # .L_XMM_QWORD_ROR8
# Useful QWORD "arrays" for simpler memory references
# MSG, DIGEST, K_t are arrays
@@ -98,7 +98,7 @@ XROR8 = %xmm15 # XMM_QWORD_ROR8
#define DIGEST(i) 8*i(digest)
# SHA Constants (static mem)
-#define K_t(i) 8*i+K512(%rip)
+#define K_t(i) 8*i+.L_K512(%rip)
# Add \mem to \reg, then copy the result back to \mem.
.macro addm mem reg
@@ -307,8 +307,8 @@ SYM_FUNC_START(sha512_transform_ssse3)
push msglen
push digest
- movdqa XMM_QWORD_BSWAP(%rip), XBSWAP
- movdqa XMM_QWORD_ROR8(%rip), XROR8
+ movdqa .L_XMM_QWORD_BSWAP(%rip), XBSWAP
+ movdqa .L_XMM_QWORD_ROR8(%rip), XROR8
# Load state variables
mov DIGEST(0), a_64
@@ -344,7 +344,7 @@ SYM_FUNC_START(sha512_transform_ssse3)
# iteration would avoid the register swap below, but 8 rounds per
# iteration saves ~1.1 KB of code size, which is worthwhile for this
# fallback implementation and improves I-cache residency.
- lea K512+72*8(%rip), kptr
+ lea .L_K512+72*8(%rip), kptr
mov $-(80-16)*8, toff
.align 16
@@ -414,13 +414,13 @@ SYM_FUNC_END(sha512_transform_ssse3)
.section .rodata.cst16.XMM_QWORD_BSWAP, "aM", @progbits, 16
.align 16
# Mask for byte-swapping a couple of qwords in an XMM register using pshufb.
-XMM_QWORD_BSWAP:
+.L_XMM_QWORD_BSWAP:
.octa 0x08090a0b0c0d0e0f0001020304050607
.section .rodata.cst16.XMM_QWORD_ROR8, "aM", @progbits, 16
.align 16
# Mask for rotating each qword in an XMM register right by 8 bits using pshufb.
-XMM_QWORD_ROR8:
+.L_XMM_QWORD_ROR8:
.octa 0x080f0e0d0c0b0a090007060504030201
# Mergeable 640-byte rodata section. This allows linker to merge the table
@@ -429,7 +429,7 @@ XMM_QWORD_ROR8:
.section .rodata.cst640.K512, "aM", @progbits, 640
.align 64
# K[t] used in SHA512 hashing
-K512:
+.L_K512:
.quad 0x428a2f98d728ae22,0x7137449123ef65cd
.quad 0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
.quad 0x3956c25bf348b538,0x59f111f1b605d019
--
2.56.1
prev parent reply other threads:[~2026-11-22 2:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 2:20 [PATCH 0/8] lib/crypto: De-bloat and optimize sha512-ssse3-asm.S Eric Biggers
2026-11-22 2:20 ` [PATCH 1/8] lib/crypto: x86/sha512: Partially roll up sha512_transform_ssse3() Eric Biggers
2026-11-22 2:20 ` [PATCH 2/8] lib/crypto: x86/sha512: Keep message schedule in XMM registers Eric Biggers
2026-11-22 2:20 ` [PATCH 3/8] lib/crypto: x86/sha512: Keep W[t]+K[t] in %xmm5 instead of stack Eric Biggers
2026-11-22 2:20 ` [PATCH 4/8] lib/crypto: x86/sha512: Keep XMM_QWORD_BSWAP in %xmm14 across blocks Eric Biggers
2026-11-22 2:20 ` [PATCH 5/8] lib/crypto: x86/sha512: Use pshufb for ror64(x, 8) in SSSE3 s0 Eric Biggers
2026-11-22 2:20 ` [PATCH 6/8] lib/crypto: x86/sha512: Keep state in registers across blocks in SSSE3 Eric Biggers
2026-11-22 2:20 ` [PATCH 7/8] lib/crypto: x86/sha512: Shorten critical-path additions " Eric Biggers
2026-11-22 2:20 ` Eric Biggers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261122022030.296468-9-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox