|
@ -19,15 +19,15 @@ use wasmtime_environ::{FuncIndex, WasmType}; |
|
|
macro_rules! def_unsupported { |
|
|
macro_rules! def_unsupported { |
|
|
($( @$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident)*) => { |
|
|
($( @$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident)*) => { |
|
|
$( |
|
|
$( |
|
|
def_unsupported!( |
|
|
def_unsupported!( |
|
|
emit |
|
|
emit |
|
|
$op |
|
|
$op |
|
|
|
|
|
|
|
|
fn $visit(&mut self $($(,$arg: $argty)*)?) -> Self::Output { |
|
|
fn $visit(&mut self $($(,$arg: $argty)*)?) -> Self::Output { |
|
|
$($(let _ = $arg;)*)? |
|
|
$($(let _ = $arg;)*)? |
|
|
todo!(stringify!($op)) |
|
|
todo!(stringify!($op)) |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
)* |
|
|
)* |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -93,45 +93,39 @@ where |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i32_add(&mut self) { |
|
|
fn visit_i32_add(&mut self) { |
|
|
self.context |
|
|
self.context.i32_binop(self.masm, |masm, dst, src, size| { |
|
|
.i32_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.add(dst, dst, src, size); |
|
|
masm.add(dst, dst, src, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i64_add(&mut self) { |
|
|
fn visit_i64_add(&mut self) { |
|
|
self.context |
|
|
self.context.i64_binop(self.masm, |masm, dst, src, size| { |
|
|
.i64_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.add(dst, dst, src, size); |
|
|
masm.add(dst, dst, src, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i32_sub(&mut self) { |
|
|
fn visit_i32_sub(&mut self) { |
|
|
self.context |
|
|
self.context.i32_binop(self.masm, |masm, dst, src, size| { |
|
|
.i32_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.sub(dst, dst, src, size); |
|
|
masm.sub(dst, dst, src, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i64_sub(&mut self) { |
|
|
fn visit_i64_sub(&mut self) { |
|
|
self.context |
|
|
self.context.i64_binop(self.masm, |masm, dst, src, size| { |
|
|
.i64_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.sub(dst, dst, src, size); |
|
|
masm.sub(dst, dst, src, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i32_mul(&mut self) { |
|
|
fn visit_i32_mul(&mut self) { |
|
|
self.context |
|
|
self.context.i32_binop(self.masm, |masm, dst, src, size| { |
|
|
.i32_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.mul(dst, dst, src, size); |
|
|
masm.mul(dst, dst, src, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i64_mul(&mut self) { |
|
|
fn visit_i64_mul(&mut self) { |
|
|
self.context |
|
|
self.context.i64_binop(self.masm, |masm, dst, src, size| { |
|
|
.i64_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.mul(dst, dst, src, size); |
|
|
masm.mul(dst, dst, src, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn visit_i32_div_s(&mut self) { |
|
|
fn visit_i32_div_s(&mut self) { |
|
@ -328,15 +322,14 @@ where |
|
|
M: MacroAssembler, |
|
|
M: MacroAssembler, |
|
|
{ |
|
|
{ |
|
|
fn cmp_i32s(&mut self, kind: CmpKind) { |
|
|
fn cmp_i32s(&mut self, kind: CmpKind) { |
|
|
self.context |
|
|
self.context.i32_binop(self.masm, |masm, dst, src, size| { |
|
|
.i32_binop(self.masm, &mut |masm, dst, src, size| { |
|
|
masm.cmp_with_set(src, dst, kind, size); |
|
|
masm.cmp_with_set(src, dst, kind, size); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fn cmp_i64s(&mut self, kind: CmpKind) { |
|
|
fn cmp_i64s(&mut self, kind: CmpKind) { |
|
|
self.context |
|
|
self.context |
|
|
.i64_binop(self.masm, &mut move |masm, dst, src, size| { |
|
|
.i64_binop(self.masm, move |masm, dst, src, size| { |
|
|
masm.cmp_with_set(src, dst, kind, size); |
|
|
masm.cmp_with_set(src, dst, kind, size); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|