From 641646376b81593be9490864d56b25cd9922f630 Mon Sep 17 00:00:00 2001 From: George Hu Date: Wed, 26 Nov 2025 16:45:46 +0800 Subject: [PATCH] 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 Reviewed-by: Daniel Kiper --- 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