Skip to content

Commit e365f99

Browse files
committed
ZJIT: Split shift with immediate operand
1 parent 643ca81 commit e365f99

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
@@ -667,12 +667,7 @@ impl Assembler
667667
Insn::URShift { opnd, .. } => {
668668
// The operand must be in a register, so
669669
// if we get anything else we need to load it first.
670-
let opnd0 = match opnd {
671-
Opnd::Mem(_) => split_load_operand(asm, *opnd),
672-
_ => *opnd
673-
};
674-
675-
*opnd = opnd0;
670+
*opnd = split_load_operand(asm, *opnd);
676671
asm.push_insn(insn);
677672
},
678673
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