]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
lib/x86_64/setjmp: Use 32-bit zero idiom for shorter encoding
authorGeorge Hu <integral@archlinux.org>
Wed, 26 Nov 2025 08:45:46 +0000 (16:45 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sun, 21 Dec 2025 15:41:46 +0000 (16:41 +0100)
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>
grub-core/lib/x86_64/setjmp.S

index 6b151bc4d936110755f72b68117786f0b6e36454..4c6c81249af7eaabbbdfd4ba18279e5c51c48d84 100644 (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