ruby-changes:73297
From: Maxime <ko1@a...>
Date: Tue, 30 Aug 2022 01:08:04 +0900 (JST)
Subject: [ruby-changes:73297] 1cf9f56c55 (master): Fix issue with expandarray, add missing jl, enable tests (https://github.com/Shopify/ruby/pull/409)
https://git.ruby-lang.org/ruby.git/commit/?id=1cf9f56c55 From 1cf9f56c55b1a771217678843c9546e368db0af3 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maximechevalierb@g...> Date: Wed, 17 Aug 2022 12:23:59 -0400 Subject: Fix issue with expandarray, add missing jl, enable tests (https://github.com/Shopify/ruby/pull/409) --- yjit/src/backend/arm64/mod.rs | 3 +++ yjit/src/backend/ir.rs | 2 ++ yjit/src/backend/x86_64/mod.rs | 8 ++++++++ yjit/src/codegen.rs | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/yjit/src/backend/arm64/mod.rs b/yjit/src/backend/arm64/mod.rs index 64136bfdd2..d92b4778e3 100644 --- a/yjit/src/backend/arm64/mod.rs +++ b/yjit/src/backend/arm64/mod.rs @@ -826,6 +826,9 @@ impl Assembler https://github.com/ruby/ruby/blob/trunk/yjit/src/backend/arm64/mod.rs#L826 Op::Jne => { emit_conditional_jump::<{Condition::NE}>(cb, insn.target.unwrap()); }, + Op::Jl => { + emit_conditional_jump::<{Condition::LT}>(cb, insn.target.unwrap()); + }, Op::Jbe => { emit_conditional_jump::<{Condition::LS}>(cb, insn.target.unwrap()); }, diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs index ef8cd5e872..952c8f7f10 100644 --- a/yjit/src/backend/ir.rs +++ b/yjit/src/backend/ir.rs @@ -118,6 +118,7 @@ pub enum Op https://github.com/ruby/ruby/blob/trunk/yjit/src/backend/ir.rs#L118 JmpOpnd, // Low-level conditional jump instructions + Jl, Jbe, Je, Jne, @@ -988,6 +989,7 @@ def_push_1_opnd_no_out!(jmp_opnd, Op::JmpOpnd); https://github.com/ruby/ruby/blob/trunk/yjit/src/backend/ir.rs#L989 def_push_jcc!(jmp, Op::Jmp); def_push_jcc!(je, Op::Je); def_push_jcc!(jne, Op::Jne); +def_push_jcc!(jl, Op::Jl); def_push_jcc!(jbe, Op::Jbe); def_push_jcc!(jz, Op::Jz); def_push_jcc!(jnz, Op::Jnz); diff --git a/yjit/src/backend/x86_64/mod.rs b/yjit/src/backend/x86_64/mod.rs index d474c9fe59..1ec08dd787 100644 --- a/yjit/src/backend/x86_64/mod.rs +++ b/yjit/src/backend/x86_64/mod.rs @@ -465,6 +465,14 @@ impl Assembler https://github.com/ruby/ruby/blob/trunk/yjit/src/backend/x86_64/mod.rs#L465 } } + Op::Jl => { + match insn.target.unwrap() { + Target::CodePtr(code_ptr) => jl_ptr(cb, code_ptr), + Target::Label(label_idx) => jl_label(cb, label_idx), + _ => unreachable!() + } + }, + Op::Jbe => { match insn.target.unwrap() { Target::CodePtr(code_ptr) => jbe_ptr(cb, code_ptr), diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index ed11f7cf0f..2e202ce2d0 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -1445,7 +1445,7 @@ fn gen_expandarray( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L1445 // Only handle the case where the number of values in the array is greater // than or equal to the number of values requested. asm.cmp(array_len_opnd, num.into()); - asm.jo(counted_exit!(ocb, side_exit, expandarray_rhs_too_small).into()); + asm.jl(counted_exit!(ocb, side_exit, expandarray_rhs_too_small).into()); // Load the address of the embedded array into REG1. // (struct RArray *)(obj)->as.ary -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/