1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/misc
Alan Wu 91a9062626
YJIT: use shorter encoding for mov(r64,imm) when unambiguous (#5081)
* YJIT: use shorter encoding for mov(r64,imm) when unambiguous

Previously, for small constants such as `mov(RAX, imm_opnd(Qundef))`,
we emit an instruction with an 8-byte immediate. This form commonly
gets the `movabs` mnemonic.

In 64-bit mode, 32-bit operands get zero extended to 64-bit to fill the
register, so when the immediate is small enough, we can save 4 bytes by
using the `mov` variant that takes a 32-bit immediate and does a zero
extension.

Not implement with this change, there is an imm32 variant of `mov` that
does sign extension we could use. When the constant is negative, we
fallback to the `movabs` form.

In railsbench, this change yields roughly a 12% code size reduction for
the outlined block.

Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>

* [ci skip] comment edit. Please squash.

Co-authored-by: Jemma Issroff <jemmaissroff@gmail.com>
2021-11-05 15:44:29 -04:00
..
expand_tabs.rb
lldb_cruby.py Follow up the RString change [ci skip] 2021-10-28 08:58:59 +09:00
lldb_disasm.py Fix typos 2021-11-02 19:17:37 +09:00
lldb_yjit.py
rb_optparse.bash
rb_optparse.zsh
README
ruby-style.el
test_lldb_cruby.rb
test_yjit_asm.sh Move the test file 2021-10-21 13:07:48 +09:00
yjit_asm_tests.c YJIT: use shorter encoding for mov(r64,imm) when unambiguous (#5081) 2021-11-05 15:44:29 -04:00

README             this file
rb_optparse.bash   bash completion script
rb_optparse.zsh    zsh completion script
ruby-style.el      Ruby's C/C++ mode style for emacs
lldb_cruby.py      LLDB port of debug utility
test_lldb_cruby.rb test file for LLDB port