summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2023-08-03 16:14:44 -0400
committerGitHub <noreply@github.com>2023-08-03 16:14:44 -0400
commit4f99240b2e457608e3a86926df7aa4baf535ef0d (patch)
treeb072e677312afd1b6d8a76b2fa5a8899f8d67887 /yjit
parent98b4256aa7a558e19739ac1d39ba10179277e1f4 (diff)
YJIT: add jb (unsigned less-than) instruction to backend (#8168)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/backend/arm64/mod.rs3
-rw-r--r--yjit/src/backend/ir.rs8
-rw-r--r--yjit/src/backend/x86_64/mod.rs8
3 files changed, 18 insertions, 1 deletions
diff --git a/yjit/src/backend/arm64/mod.rs b/yjit/src/backend/arm64/mod.rs
index a74e5cf0ff..01485d1df6 100644
--- a/yjit/src/backend/arm64/mod.rs
+++ b/yjit/src/backend/arm64/mod.rs
@@ -1085,6 +1085,9 @@ impl Assembler
Insn::Jbe(target) => {
emit_conditional_jump::<{Condition::LS}>(cb, compile_side_exit(*target, self, ocb));
},
+ Insn::Jb(target) => {
+ emit_conditional_jump::<{Condition::CC}>(cb, compile_side_exit(*target, self, ocb));
+ },
Insn::Jo(target) => {
emit_conditional_jump::<{Condition::VS}>(cb, compile_side_exit(*target, self, ocb));
},
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs
index 4e7e9a1542..888922579d 100644
--- a/yjit/src/backend/ir.rs
+++ b/yjit/src/backend/ir.rs
@@ -423,9 +423,12 @@ pub enum Insn {
// Produces no output
IncrCounter { mem: Opnd, value: Opnd },
- /// Jump if below or equal
+ /// Jump if below or equal (unsigned)
Jbe(Target),
+ /// Jump if below (unsigned)
+ Jb(Target),
+
/// Jump if equal
Je(Target),
@@ -579,6 +582,7 @@ impl Insn {
Insn::FrameTeardown => "FrameTeardown",
Insn::IncrCounter { .. } => "IncrCounter",
Insn::Jbe(_) => "Jbe",
+ Insn::Jb(_) => "Jb",
Insn::Je(_) => "Je",
Insn::Jl(_) => "Jl",
Insn::Jg(_) => "Jg",
@@ -727,6 +731,7 @@ impl<'a> Iterator for InsnOpndIterator<'a> {
Insn::FrameSetup |
Insn::FrameTeardown |
Insn::Jbe(_) |
+ Insn::Jb(_) |
Insn::Je(_) |
Insn::Jl(_) |
Insn::Jg(_) |
@@ -825,6 +830,7 @@ impl<'a> InsnOpndMutIterator<'a> {
Insn::FrameSetup |
Insn::FrameTeardown |
Insn::Jbe(_) |
+ Insn::Jb(_) |
Insn::Je(_) |
Insn::Jl(_) |
Insn::Jg(_) |
diff --git a/yjit/src/backend/x86_64/mod.rs b/yjit/src/backend/x86_64/mod.rs
index 1ae5ee7477..f60a31a9c3 100644
--- a/yjit/src/backend/x86_64/mod.rs
+++ b/yjit/src/backend/x86_64/mod.rs
@@ -709,6 +709,14 @@ impl Assembler
}
},
+ Insn::Jb(target) => {
+ match compile_side_exit(*target, self, ocb) {
+ Target::CodePtr(code_ptr) | Target::SideExitPtr(code_ptr) => jb_ptr(cb, code_ptr),
+ Target::Label(label_idx) => jb_label(cb, label_idx),
+ Target::SideExit { .. } => unreachable!("Target::SideExit should have been compiled by compile_side_exit"),
+ }
+ },
+
Insn::Jz(target) => {
match compile_side_exit(*target, self, ocb) {
Target::CodePtr(code_ptr) | Target::SideExitPtr(code_ptr) => jz_ptr(cb, code_ptr),