MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / unop

Method unop

winch/codegen/src/codegen/context.rs:339–349  ·  view source on GitHub ↗

Prepares arguments for emitting a unary operation. The `emit` function returns the `TypedReg` to put on the value stack.

(&mut self, masm: &mut M, emit: F)

Source from the content-addressed store, hash-verified

337 ///
338 /// The `emit` function returns the `TypedReg` to put on the value stack.
339 pub fn unop<F, M>(&mut self, masm: &mut M, emit: F) -> Result<()>
340 where
341 F: FnOnce(&mut M, Reg) -> Result<TypedReg>,
342 M: MacroAssembler,
343 {
344 let typed_reg = self.pop_to_reg(masm, None)?;
345 let dst = emit(masm, typed_reg.reg)?;
346 self.stack.push(dst.into());
347
348 Ok(())
349 }
350
351 /// Prepares arguments for emitting a binary operation.
352 ///

Callers 15

visit_f32_absMethod · 0.80
visit_f64_absMethod · 0.80
visit_f32_negMethod · 0.80
visit_f64_negMethod · 0.80
visit_f32_sqrtMethod · 0.80
visit_f64_sqrtMethod · 0.80
visit_f32_demote_f64Method · 0.80
visit_f64_promote_f32Method · 0.80
visit_i32_eqzMethod · 0.80
visit_i64_eqzMethod · 0.80
visit_i32_clzMethod · 0.80
visit_i64_clzMethod · 0.80

Calls 4

emitFunction · 0.85
OkFunction · 0.85
pop_to_regMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected