From: George Hu Date: Mon, 9 Feb 2026 19:22:18 +0000 (+0100) Subject: x86-64: Use 32-bit zero idiom for shorter encoding X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d71a81ab37336fe0b6dd6945ea8c195797bf4800;p=thirdparty%2Fglibc.git x86-64: Use 32-bit zero idiom for shorter encoding Replace the 64-bit zero idiom with the 32-bit form. In 64-bit mode, zeroing the lower 32 bits of a GPR implicitly clears the entire register. The 32-bit encoding is one byte shorter while preserving identical semantics. Reviewed-by: Samuel Thibault --- diff --git a/sysdeps/mach/hurd/x86_64/static-start.S b/sysdeps/mach/hurd/x86_64/static-start.S index ec9c50239e..d670d45210 100644 --- a/sysdeps/mach/hurd/x86_64/static-start.S +++ b/sysdeps/mach/hurd/x86_64/static-start.S @@ -27,7 +27,7 @@ _start: movq %rsp, %rdi call _hurd_stack_setup - xorq %rdx, %rdx + xorl %edx, %edx jmp _start1 #define _start _start1 diff --git a/sysdeps/mach/hurd/x86_64/tst-sig-redzone.c b/sysdeps/mach/hurd/x86_64/tst-sig-redzone.c index 32c7ab90f4..24b510c0aa 100644 --- a/sysdeps/mach/hurd/x86_64/tst-sig-redzone.c +++ b/sysdeps/mach/hurd/x86_64/tst-sig-redzone.c @@ -103,7 +103,7 @@ asm ( "repe scasq\n" " jne fail\n" -" xor %rax,%rax\n" +" xor %eax,%eax\n" " ret\n" "fail:\n" " movq $1,%rax\n"