Prepares arguments for emitting a binary operation. The `emit` function returns the `TypedReg` to put on the value stack.
(&mut self, masm: &mut M, size: OperandSize, emit: F)
| 352 | /// |
| 353 | /// The `emit` function returns the `TypedReg` to put on the value stack. |
| 354 | pub fn binop<F, M>(&mut self, masm: &mut M, size: OperandSize, emit: F) -> Result<()> |
| 355 | where |
| 356 | F: FnOnce(&mut M, Reg, Reg, OperandSize) -> Result<TypedReg>, |
| 357 | M: MacroAssembler, |
| 358 | { |
| 359 | let src = self.pop_to_reg(masm, None)?; |
| 360 | let dst = self.pop_to_reg(masm, None)?; |
| 361 | let dst = emit(masm, dst.reg, src.reg, size)?; |
| 362 | self.free_reg(src); |
| 363 | self.stack.push(dst.into()); |
| 364 | |
| 365 | Ok(()) |
| 366 | } |
| 367 | |
| 368 | /// Prepares arguments for emitting an f32 or f64 comparison operation. |
| 369 | pub fn float_cmp_op<F, M>(&mut self, masm: &mut M, size: OperandSize, emit: F) -> Result<()> |
no test coverage detected