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

Method xrem32_s

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

Source from the content-addressed store, hash-verified

2205 }
2206
2207 fn xrem32_s(&mut self, operands: BinaryOperands<XReg>) -> ControlFlow<Done> {
2208 let a = self.state[operands.src1].get_i32();
2209 let b = self.state[operands.src2].get_i32();
2210 let result = if a == i32::MIN && b == -1 {
2211 Some(0)
2212 } else {
2213 a.checked_rem(b)
2214 };
2215 match result {
2216 Some(result) => {
2217 self.state[operands.dst].set_i32(result);
2218 ControlFlow::Continue(())
2219 }
2220 None => self.done_trap_kind::<crate::XRem32S>(Some(TrapKind::DivideByZero)),
2221 }
2222 }
2223
2224 fn xrem64_s(&mut self, operands: BinaryOperands<XReg>) -> ControlFlow<Done> {
2225 let a = self.state[operands.src1].get_i64();

Callers

nothing calls this directly

Calls 3

checked_remMethod · 0.80
set_i32Method · 0.80
get_i32Method · 0.45

Tested by

no test coverage detected