lib/x86_64/setjmp: Use 32-bit zero idiom for shorter encoding

Switch from "xorq %rax, %rax" to "xorl %eax, %eax". In 64-bit mode
zeroing EAX implicitly clears RAX and the 32-bit form encodes are one
byte smaller while keeping identical semantics.

Signed-off-by: George Hu <integral@archlinux.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
George Hu 2025-11-26 16:45:46 +08:00 committed by Daniel Kiper
parent d07ebd11d6
commit 641646376b

View File

@ -36,7 +36,7 @@ GRUB_MOD_LICENSE "GPLv3+"
*/ */
FUNCTION(grub_setjmp) FUNCTION(grub_setjmp)
pop %rsi /* Return address, and adjust the stack */ pop %rsi /* Return address, and adjust the stack */
xorq %rax, %rax xorl %eax, %eax
movq %rbx, 0(%rdi) /* RBX */ movq %rbx, 0(%rdi) /* RBX */
movq %rsp, 8(%rdi) /* RSP */ movq %rsp, 8(%rdi) /* RSP */
push %rsi push %rsi