Prepares arguments for emitting an i64 binary operation. The `emit` function returns the `TypedReg` to put on the value stack.
(&mut self, masm: &mut M, emit: F)
| 417 | /// |
| 418 | /// The `emit` function returns the `TypedReg` to put on the value stack. |
| 419 | pub fn i64_binop<F, M>(&mut self, masm: &mut M, emit: F) -> Result<()> |
| 420 | where |
| 421 | F: FnOnce(&mut M, Reg, RegImm, OperandSize) -> Result<TypedReg>, |
| 422 | M: MacroAssembler, |
| 423 | { |
| 424 | match self.pop_i64_const() { |
| 425 | Some(val) => { |
| 426 | let typed_reg = self.pop_to_reg(masm, None)?; |
| 427 | let dst = emit(masm, typed_reg.reg, RegImm::i64(val), OperandSize::S64)?; |
| 428 | self.stack.push(dst.into()); |
| 429 | } |
| 430 | None => self.binop(masm, OperandSize::S64, |masm, dst, src, size| { |
| 431 | emit(masm, dst, src.into(), size) |
| 432 | })?, |
| 433 | } |
| 434 | Ok(()) |
| 435 | } |
| 436 | |
| 437 | /// Returns the i32 const on top of the stack or None if there isn't one. |
| 438 | pub fn pop_i32_const(&mut self) -> Option<i32> { |
no test coverage detected