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

Method xdiv32_s

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

Source from the content-addressed store, hash-verified

2143 }
2144
2145 fn xdiv32_s(&mut self, operands: BinaryOperands<XReg>) -> ControlFlow<Done> {
2146 let a = self.state[operands.src1].get_i32();
2147 let b = self.state[operands.src2].get_i32();
2148 match a.checked_div(b) {
2149 Some(result) => {
2150 self.state[operands.dst].set_i32(result);
2151 ControlFlow::Continue(())
2152 }
2153 None => {
2154 let kind = if b == 0 {
2155 TrapKind::DivideByZero
2156 } else {
2157 TrapKind::IntegerOverflow
2158 };
2159 self.done_trap_kind::<crate::XDiv32S>(Some(kind))
2160 }
2161 }
2162 }
2163
2164 fn xdiv64_s(&mut self, operands: BinaryOperands<XReg>) -> ControlFlow<Done> {
2165 let a = self.state[operands.src1].get_i64();

Callers

nothing calls this directly

Calls 3

checked_divMethod · 0.80
set_i32Method · 0.80
get_i32Method · 0.45

Tested by

no test coverage detected