MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / exec_fma_store

Method exec_fma_store

crates/tinywasm/src/interpreter/executor.rs:1160–1175  ·  view source on GitHub ↗
(
        &mut self,
        m: MemoryArg,
    )

Source from the content-addressed store, hash-verified

1158
1159 #[inline(always)]
1160 fn exec_fma_store<
1161 T: InternalValue + MemValue<N> + core::ops::Add<Output = T> + core::ops::Mul<Output = T>,
1162 const N: usize,
1163 >(
1164 &mut self,
1165 m: MemoryArg,
1166 ) -> Result<(), Trap> {
1167 let rhs = T::stack_pop(&mut self.store.value_stack);
1168 let lhs = T::stack_pop(&mut self.store.value_stack);
1169 let acc = T::stack_pop(&mut self.store.value_stack);
1170 let addr = i32::stack_pop(&mut self.store.value_stack);
1171 let fma = acc + lhs * rhs;
1172 let mem = self.store.state.get_mem_mut(self.module.resolve_mem_addr(m.mem_addr()));
1173 mem.store(addr as u32 as u64, m.offset(), fma.to_mem_bytes())?;
1174 Ok(())
1175 }
1176
1177 #[inline(always)]
1178 fn exec_binop_acc_local<T, M, A>(&mut self, acc: LocalAddr, mul: M, add: A)

Callers

nothing calls this directly

Calls 6

get_mem_mutMethod · 0.80
resolve_mem_addrMethod · 0.80
mem_addrMethod · 0.80
to_mem_bytesMethod · 0.80
storeMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected