Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ZJIT: x64: Prefer 7-byte sign extending mov over 10-byte movabs#16992

Open
XrXr wants to merge 1 commit into
ruby:masterfrom
Shopify:zjit-x64-imm
Open

ZJIT: x64: Prefer 7-byte sign extending mov over 10-byte movabs#16992
XrXr wants to merge 1 commit into
ruby:masterfrom
Shopify:zjit-x64-imm

Conversation

@XrXr
Copy link
Copy Markdown
Member

@XrXr XrXr commented May 15, 2026

Relevant for small negative immediates. Previously:

# Insn: v16 SetLocal l1, EP@3, v10
mov rsi, qword ptr [r13 + 0x20]
mov rsi, qword ptr [rsi - 8]
and rsi, 0xfffffffffffffffc
# call rb_vm_env_write
push rdi
push rdi
mov rdx, rdi
mov rdi, rsi
movabs rsi, 0xfffffffffffffffd

+patch/master code_region_bytes ratio = 12,029,952 / 12,136,448 ~= 0.991 on a default 25 iteration run of lobsters on ruby/ruby-bench.

@XrXr XrXr marked this pull request as ready for review May 16, 2026 02:31
@matzbot matzbot requested a review from a team May 16, 2026 02:31
Relevant for small negative immediates. Previously:

  # Insn: v16 SetLocal l1, EP@3, v10
  mov rsi, qword ptr [r13 + 0x20]
  mov rsi, qword ptr [rsi - 8]
  and rsi, 0xfffffffffffffffc
  # call rb_vm_env_write
  push rdi
  push rdi
  mov rdx, rdi
  mov rdi, rsi
  movabs rsi, 0xfffffffffffffffd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant