Prepares arguments for emitting an i32 binary operation. The `emit` function returns the `TypedReg` to put on the value stack.
(&mut self, masm: &mut M, mut emit: F)
| 396 | /// |
| 397 | /// The `emit` function returns the `TypedReg` to put on the value stack. |
| 398 | pub fn i32_binop<F, M>(&mut self, masm: &mut M, mut emit: F) -> Result<()> |
| 399 | where |
| 400 | F: FnMut(&mut M, Reg, RegImm, OperandSize) -> Result<TypedReg>, |
| 401 | M: MacroAssembler, |
| 402 | { |
| 403 | match self.pop_i32_const() { |
| 404 | Some(val) => { |
| 405 | let typed_reg = self.pop_to_reg(masm, None)?; |
| 406 | let dst = emit(masm, typed_reg.reg, RegImm::i32(val), OperandSize::S32)?; |
| 407 | self.stack.push(dst.into()); |
| 408 | } |
| 409 | None => self.binop(masm, OperandSize::S32, |masm, dst, src, size| { |
| 410 | emit(masm, dst, src.into(), size) |
| 411 | })?, |
| 412 | } |
| 413 | Ok(()) |
| 414 | } |
| 415 | |
| 416 | /// Prepares arguments for emitting an i64 binary operation. |
| 417 | /// |
no test coverage detected