зеркало из https://github.com/github/ruby.git
YJIT: add missing jge comparison instruction (#9819)
I ran into this while trying to implement setbyte, was surprised to find out we hadn't implemented it yet.
This commit is contained in:
Родитель
aa780a678e
Коммит
5a87e9e2b5
|
@ -1135,6 +1135,9 @@ impl Assembler
|
|||
Insn::Jg(target) => {
|
||||
emit_conditional_jump::<{Condition::GT}>(cb, compile_side_exit(*target, self, ocb)?);
|
||||
},
|
||||
Insn::Jge(target) => {
|
||||
emit_conditional_jump::<{Condition::GE}>(cb, compile_side_exit(*target, self, ocb)?);
|
||||
},
|
||||
Insn::Jbe(target) => {
|
||||
emit_conditional_jump::<{Condition::LS}>(cb, compile_side_exit(*target, self, ocb)?);
|
||||
},
|
||||
|
|
|
@ -423,6 +423,9 @@ pub enum Insn {
|
|||
/// Jump if greater
|
||||
Jg(Target),
|
||||
|
||||
/// Jump if greater or equal
|
||||
Jge(Target),
|
||||
|
||||
// Unconditional jump to a branch target
|
||||
Jmp(Target),
|
||||
|
||||
|
@ -532,6 +535,7 @@ impl Insn {
|
|||
Insn::Je(target) |
|
||||
Insn::Jl(target) |
|
||||
Insn::Jg(target) |
|
||||
Insn::Jge(target) |
|
||||
Insn::Jmp(target) |
|
||||
Insn::Jne(target) |
|
||||
Insn::Jnz(target) |
|
||||
|
@ -578,6 +582,7 @@ impl Insn {
|
|||
Insn::Je(_) => "Je",
|
||||
Insn::Jl(_) => "Jl",
|
||||
Insn::Jg(_) => "Jg",
|
||||
Insn::Jge(_) => "Jge",
|
||||
Insn::Jmp(_) => "Jmp",
|
||||
Insn::JmpOpnd(_) => "JmpOpnd",
|
||||
Insn::Jne(_) => "Jne",
|
||||
|
@ -682,6 +687,7 @@ impl Insn {
|
|||
Insn::Je(target) |
|
||||
Insn::Jl(target) |
|
||||
Insn::Jg(target) |
|
||||
Insn::Jge(target) |
|
||||
Insn::Jmp(target) |
|
||||
Insn::Jne(target) |
|
||||
Insn::Jnz(target) |
|
||||
|
@ -733,6 +739,7 @@ impl<'a> Iterator for InsnOpndIterator<'a> {
|
|||
Insn::Je(_) |
|
||||
Insn::Jl(_) |
|
||||
Insn::Jg(_) |
|
||||
Insn::Jge(_) |
|
||||
Insn::Jmp(_) |
|
||||
Insn::Jne(_) |
|
||||
Insn::Jnz(_) |
|
||||
|
@ -834,6 +841,7 @@ impl<'a> InsnOpndMutIterator<'a> {
|
|||
Insn::Je(_) |
|
||||
Insn::Jl(_) |
|
||||
Insn::Jg(_) |
|
||||
Insn::Jge(_) |
|
||||
Insn::Jmp(_) |
|
||||
Insn::Jne(_) |
|
||||
Insn::Jnz(_) |
|
||||
|
@ -1805,6 +1813,11 @@ impl Assembler {
|
|||
self.push_insn(Insn::Jg(target));
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn jge(&mut self, target: Target) {
|
||||
self.push_insn(Insn::Jge(target));
|
||||
}
|
||||
|
||||
pub fn jmp(&mut self, target: Target) {
|
||||
self.push_insn(Insn::Jmp(target));
|
||||
}
|
||||
|
|
|
@ -730,6 +730,14 @@ impl Assembler
|
|||
}
|
||||
},
|
||||
|
||||
Insn::Jge(target) => {
|
||||
match compile_side_exit(*target, self, ocb)? {
|
||||
Target::CodePtr(code_ptr) | Target::SideExitPtr(code_ptr) => jge_ptr(cb, code_ptr),
|
||||
Target::Label(label_idx) => jge_label(cb, label_idx),
|
||||
Target::SideExit { .. } => unreachable!("Target::SideExit should have been compiled by compile_side_exit"),
|
||||
}
|
||||
},
|
||||
|
||||
Insn::Jbe(target) => {
|
||||
match compile_side_exit(*target, self, ocb)? {
|
||||
Target::CodePtr(code_ptr) | Target::SideExitPtr(code_ptr) => jbe_ptr(cb, code_ptr),
|
||||
|
|
Загрузка…
Ссылка в новой задаче