winch: Add support for integer multiplication in x64. (#5769)
This commit adds support for the `<i32|i64>.mul` WebAssembly instructions in x64.
This commit is contained in:
@@ -36,6 +36,8 @@ macro_rules! def_unsupported {
|
||||
(emit I32Add $($rest:tt)*) => {};
|
||||
(emit I64Add $($rest:tt)*) => {};
|
||||
(emit I32Sub $($rest:tt)*) => {};
|
||||
(emit I32Mul $($rest:tt)*) => {};
|
||||
(emit I64Mul $($rest:tt)*) => {};
|
||||
(emit I64Sub $($rest:tt)*) => {};
|
||||
(emit LocalGet $($rest:tt)*) => {};
|
||||
(emit LocalSet $($rest:tt)*) => {};
|
||||
@@ -86,6 +88,20 @@ where
|
||||
});
|
||||
}
|
||||
|
||||
fn visit_i32_mul(&mut self) {
|
||||
self.context
|
||||
.i32_binop(&mut self.regalloc, &mut |masm: &mut M, dst, src, size| {
|
||||
masm.mul(dst, dst, src, size);
|
||||
});
|
||||
}
|
||||
|
||||
fn visit_i64_mul(&mut self) {
|
||||
self.context
|
||||
.i64_binop(&mut self.regalloc, &mut |masm: &mut M, dst, src, size| {
|
||||
masm.mul(dst, dst, src, size);
|
||||
});
|
||||
}
|
||||
|
||||
fn visit_end(&mut self) {}
|
||||
|
||||
fn visit_local_get(&mut self, index: u32) {
|
||||
|
||||
Reference in New Issue
Block a user