diff options
author | Takashi Kokubun <[email protected]> | 2023-09-29 18:55:48 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-09-29 21:55:48 -0400 |
commit | 0b67e3fd3ee9969a0c92867bec365104f2b43897 (patch) | |
tree | e62dd1b49e3bf16cd0346efad2f43fab220bb671 /yjit/src/backend/ir.rs | |
parent | f9f728e804367ac8de4709884fec64c13a7cff54 (diff) |
YJIT: Chain-guard opt_mult overflow (#8554)
* YJIT: Chain-guard opt_mult overflow
* YJIT: Support regenerating Jo after Mul
Diffstat (limited to 'yjit/src/backend/ir.rs')
-rw-r--r-- | yjit/src/backend/ir.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs index 479a4df3db..10e463885b 100644 --- a/yjit/src/backend/ir.rs +++ b/yjit/src/backend/ir.rs @@ -447,6 +447,9 @@ pub enum Insn { /// Jump if overflow Jo(Target), + /// Jump if overflow in multiplication + JoMul(Target), + /// Jump if zero Jz(Target), @@ -590,6 +593,7 @@ impl Insn { Insn::Jne(_) => "Jne", Insn::Jnz(_) => "Jnz", Insn::Jo(_) => "Jo", + Insn::JoMul(_) => "JoMul", Insn::Jz(_) => "Jz", Insn::Label(_) => "Label", Insn::LeaLabel { .. } => "LeaLabel", @@ -743,6 +747,7 @@ impl<'a> Iterator for InsnOpndIterator<'a> { Insn::Jne(_) | Insn::Jnz(_) | Insn::Jo(_) | + Insn::JoMul(_) | Insn::Jz(_) | Insn::Label(_) | Insn::LeaLabel { .. } | @@ -843,6 +848,7 @@ impl<'a> InsnOpndMutIterator<'a> { Insn::Jne(_) | Insn::Jnz(_) | Insn::Jo(_) | + Insn::JoMul(_) | Insn::Jz(_) | Insn::Label(_) | Insn::LeaLabel { .. } | @@ -1861,6 +1867,10 @@ impl Assembler { self.push_insn(Insn::Jo(target)); } + pub fn jo_mul(&mut self, target: Target) { + self.push_insn(Insn::JoMul(target)); + } + pub fn jz(&mut self, target: Target) { self.push_insn(Insn::Jz(target)); } |