(&mut self)
| 2096 | } |
| 2097 | |
| 2098 | fn visit_select(&mut self) -> Self::Output { |
| 2099 | let cond = self.context.pop_to_reg(self.masm, None)?; |
| 2100 | let val2 = self.context.pop_to_reg(self.masm, None)?; |
| 2101 | let val1 = self.context.pop_to_reg(self.masm, None)?; |
| 2102 | self.masm.cmp(cond.reg, RegImm::i32(0), OperandSize::S32)?; |
| 2103 | // Conditionally move val1 to val2 if the comparison is |
| 2104 | // not zero. |
| 2105 | self.masm.cmov( |
| 2106 | writable!(val2.into()), |
| 2107 | val1.into(), |
| 2108 | IntCmpKind::Ne, |
| 2109 | val1.ty.try_into()?, |
| 2110 | )?; |
| 2111 | self.context.stack.push(val2.into()); |
| 2112 | self.context.free_reg(val1.reg); |
| 2113 | self.context.free_reg(cond); |
| 2114 | |
| 2115 | Ok(()) |
| 2116 | } |
| 2117 | |
| 2118 | fn visit_typed_select(&mut self, _ty: ValType) -> Self::Output { |
| 2119 | self.visit_select() |
no test coverage detected