Skip to content

Commit 6a97041

Browse files
committed
ZJIT: Split shift with immediate operand
1 parent 3cf32e9 commit 6a97041

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

test/ruby/test_zjit.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,16 @@ def test(a, b) = a | b
382382
}, call_threshold: 2, insns: [:opt_or]
383383
end
384384

385+
def test_fixnum_mul
386+
assert_compiles '12', %q{
387+
C = 3
388+
def test(n) = C * n
389+
test(4)
390+
test(4)
391+
test(4)
392+
}, call_threshold: 2, insns: [:opt_mult]
393+
end
394+
385395
def test_opt_not
386396
assert_compiles('[true, true, false]', <<~RUBY, insns: [:opt_not])
387397
def test(obj) = !obj

zjit/src/backend/arm64/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,12 +657,7 @@ impl Assembler
657657
Insn::URShift { opnd, .. } => {
658658
// The operand must be in a register, so
659659
// if we get anything else we need to load it first.
660-
let opnd0 = match opnd {
661-
Opnd::Mem(_) => split_load_operand(asm, *opnd),
662-
_ => *opnd
663-
};
664-
665-
*opnd = opnd0;
660+
*opnd = split_load_operand(asm, *opnd);
666661
asm.push_insn(insn);
667662
},
668663
Insn::Store { dest, src } => {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy