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 authored and Daniel Kiper committed 2025-12-21 16:41:46 +01:00
1 parent d07ebd11d6
commit 641646376b
1 file changed
+1 -1
+1 -1
View File
@@ -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