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

Method xdiv64_s

pulley/src/interp.rs:2164–2181  ·  view source on GitHub ↗
(&mut self, operands: BinaryOperands<XReg>)

Source from the content-addressed store, hash-verified

2162 }
2163
2164 fn xdiv64_s(&mut self, operands: BinaryOperands<XReg>) -> ControlFlow<Done> {
2165 let a = self.state[operands.src1].get_i64();
2166 let b = self.state[operands.src2].get_i64();
2167 match a.checked_div(b) {
2168 Some(result) => {
2169 self.state[operands.dst].set_i64(result);
2170 ControlFlow::Continue(())
2171 }
2172 None => {
2173 let kind = if b == 0 {
2174 TrapKind::DivideByZero
2175 } else {
2176 TrapKind::IntegerOverflow
2177 };
2178 self.done_trap_kind::<crate::XDiv64S>(Some(kind))
2179 }
2180 }
2181 }
2182
2183 fn xdiv32_u(&mut self, operands: BinaryOperands<XReg>) -> ControlFlow<Done> {
2184 let a = self.state[operands.src1].get_u32();

Callers

nothing calls this directly

Calls 3

checked_divMethod · 0.80
set_i64Method · 0.80
get_i64Method · 0.45

Tested by

no test coverage detected