https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82339

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 42243
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42243&action=edit
gcc8-pr82339.patch

Patch for -Os where movl $cst, %eXX; shlq $shift, %rXX is 1 byte shorter than
movabsq $(cst << shift), %rXX.
For speed, there is yet another option of movq $cst, %rXX; shlq $shift, %rXX
for constants like 0xffff123456700000 which have a sequence of 1 bit, followed
by at most 31 arbitrary bits and then the rest is all 0s,
movabsq $ffff123456700000, %r8 is equivalent to movq $-249346713, %r8; shlq
$20, %r8 which is longer, but perhaps faster (on which CPUs).

Reply via email to