]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86-64: Use 32-bit zero idiom for shorter encoding
authorGeorge Hu <integral@archlinux.org>
Mon, 9 Feb 2026 19:22:18 +0000 (20:22 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 9 Feb 2026 19:22:35 +0000 (20:22 +0100)
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 <samuel.thibault@ens-lyon.org>
sysdeps/mach/hurd/x86_64/static-start.S
sysdeps/mach/hurd/x86_64/tst-sig-redzone.c

index ec9c50239e274113671abe5bcedab665b5705c54..d670d452107862217aef3b45a69fc1277d823a8b 100644 (file)
@@ -27,7 +27,7 @@ _start:
 
        movq %rsp, %rdi
        call _hurd_stack_setup
-       xorq %rdx, %rdx
+       xorl %edx, %edx
        jmp _start1
 
 #define _start _start1
index 32c7ab90f45effe5ea65379b543a1ec40f947e0a..24b510c0aacfd7b52572bdee792359d6a9b5fc30 100644 (file)
@@ -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"