Emit better x86_64 asm for constant loads
commitc21576f8a32715ab439690d18184b0e02022bbbd
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 10 Oct 2024 20:46:14 +0000 (10 22:46 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 10 Oct 2024 20:48:56 +0000 (10 22:48 +0200)
treeb0c1d4d712eb7d34aa369339f43a2cc07c9a5335
parentb668b72b0660fd803829e9876302222411b0fa1a
Emit better x86_64 asm for constant loads

Instead of always emitting movabs, emit a regular mov or a xor.
Slims down sequences like:

    movabs $0,%rax
    mov %rsi,%rax

To:

    xor %eax,%eax  // also zeroes upper word
    mov %rsi,%rax

Future work is to just emit:

    xor %esi,%esi
x86_64-gen.c