From: George Hu <integral@archlinux.org>
To: grub-devel@gnu.org
Cc: Daniel Kiper <daniel.kiper@oracle.com>,
Alex Burmashev <alexander.burmashev@oracle.com>,
Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>,
George Hu <integral@archlinux.org>
Subject: [PATCH RESEND] lib/x86_64/setjmp: Use 32-bit zero idiom for shorter encoding
Date: Wed, 26 Nov 2025 16:45:46 +0800 [thread overview]
Message-ID: <20251126084545.163625-2-integral@archlinux.org> (raw)
Switch from `xorq %rax, %rax` to `xorl %eax, %eax`. In 64-bit mode,
zeroing EAX implicitly clears RAX, and the 32-bit form encodes one
byte smaller while keeping identical semantics.
Signed-off-by: George Hu <integral@archlinux.org>
---
grub-core/lib/x86_64/setjmp.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/lib/x86_64/setjmp.S b/grub-core/lib/x86_64/setjmp.S
index 6b151bc4d..4c6c81249 100644
--- a/grub-core/lib/x86_64/setjmp.S
+++ b/grub-core/lib/x86_64/setjmp.S
@@ -36,7 +36,7 @@ GRUB_MOD_LICENSE "GPLv3+"
*/
FUNCTION(grub_setjmp)
pop %rsi /* Return address, and adjust the stack */
- xorq %rax, %rax
+ xorl %eax, %eax
movq %rbx, 0(%rdi) /* RBX */
movq %rsp, 8(%rdi) /* RSP */
push %rsi
--
2.52.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next reply other threads:[~2025-11-26 14:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 8:45 George Hu [this message]
2025-12-18 17:28 ` [PATCH RESEND] lib/x86_64/setjmp: Use 32-bit zero idiom for shorter encoding Daniel Kiper
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=20251126084545.163625-2-integral@archlinux.org \
--to=integral@archlinux.org \
--cc=alexander.burmashev@oracle.com \
--cc=daniel.kiper@oracle.com \
--cc=grub-devel@gnu.org \
--cc=phcoder@gmail.com \
/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