mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Merge 3a7e2a4ea5
into d025bc230c
This commit is contained in:
commit
f2f1ba5ec0
1 changed files with 5 additions and 1 deletions
|
@ -1683,6 +1683,7 @@ impl Assembler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cpop_into(&mut self, opnd: Opnd) {
|
pub fn cpop_into(&mut self, opnd: Opnd) {
|
||||||
|
assert!(matches!(opnd, Opnd::Reg(_)), "Destination of cpop_into must be a register, got: {opnd:?}");
|
||||||
self.push_insn(Insn::CPopInto(opnd));
|
self.push_insn(Insn::CPopInto(opnd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1830,6 +1831,7 @@ impl Assembler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lea_into(&mut self, out: Opnd, opnd: Opnd) {
|
pub fn lea_into(&mut self, out: Opnd, opnd: Opnd) {
|
||||||
|
assert!(matches!(out, Opnd::Reg(_)), "Destination of lea_into must be a register, got: {out:?}");
|
||||||
self.push_insn(Insn::Lea { opnd, out });
|
self.push_insn(Insn::Lea { opnd, out });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1855,7 +1857,7 @@ impl Assembler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_into(&mut self, dest: Opnd, opnd: Opnd) {
|
pub fn load_into(&mut self, dest: Opnd, opnd: Opnd) {
|
||||||
assert!(matches!(dest, Opnd::Reg(_) | Opnd::VReg{..}), "Destination of load_into must be a register");
|
assert!(matches!(dest, Opnd::Reg(_)), "Destination of load_into must be a register, got: {dest:?}");
|
||||||
match (dest, opnd) {
|
match (dest, opnd) {
|
||||||
(Opnd::Reg(dest), Opnd::Reg(opnd)) if dest == opnd => {}, // skip if noop
|
(Opnd::Reg(dest), Opnd::Reg(opnd)) if dest == opnd => {}, // skip if noop
|
||||||
_ => self.push_insn(Insn::LoadInto { dest, opnd }),
|
_ => self.push_insn(Insn::LoadInto { dest, opnd }),
|
||||||
|
@ -1881,6 +1883,7 @@ impl Assembler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mov(&mut self, dest: Opnd, src: Opnd) {
|
pub fn mov(&mut self, dest: Opnd, src: Opnd) {
|
||||||
|
assert!(!matches!(dest, Opnd::VReg { .. }), "Destination of mov must not be Opnd::VReg, got: {dest:?}");
|
||||||
self.push_insn(Insn::Mov { dest, src });
|
self.push_insn(Insn::Mov { dest, src });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1918,6 +1921,7 @@ impl Assembler {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn store(&mut self, dest: Opnd, src: Opnd) {
|
pub fn store(&mut self, dest: Opnd, src: Opnd) {
|
||||||
|
assert!(!matches!(dest, Opnd::VReg { .. }), "Destination of store must not be Opnd::VReg, got: {dest:?}");
|
||||||
self.push_insn(Insn::Store { dest, src });
|
self.push_insn(Insn::Store { dest, src });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue