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

Method i64_binop

winch/codegen/src/codegen/context.rs:419–435  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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> {

Callers 7

visit_i64_addMethod · 0.80
visit_i64_subMethod · 0.80
visit_i64_mulMethod · 0.80
visit_i64_andMethod · 0.80
visit_i64_orMethod · 0.80
visit_i64_xorMethod · 0.80
cmp_i64sMethod · 0.80

Calls 7

emitFunction · 0.85
i64Function · 0.85
OkFunction · 0.85
pop_to_regMethod · 0.80
binopMethod · 0.80
pop_i64_constMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected