From: George Hu Date: Wed, 26 Nov 2025 08:45:46 +0000 (+0800) Subject: lib/x86_64/setjmp: Use 32-bit zero idiom for shorter encoding X-Git-Tag: grub-2.14~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=641646376b81593be9490864d56b25cd9922f630;p=thirdparty%2Fgrub.git 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 --- 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