cranelift: Use round_ties_even for nearest in interpreter (#4413)

As @MaxGraey pointed out (thanks!) in #4397, `round` has different
 behavior from `nearest`. And it looks like the native rust
 implementation is still pending stabilization.

 Right now we duplicate the wasmtime implementation, merged in #2171.

 However, we definitely should switch to the rust native version
 when it is available.
This commit is contained in:
Afonso Bordado
2022-07-08 00:36:43 +01:00
committed by GitHub
parent a8ce7f123b
commit 16cb287c53
6 changed files with 141 additions and 7 deletions

View File

@@ -534,7 +534,7 @@ impl Value for DataValue {
}
fn nearest(self) -> ValueResult<Self> {
unary_match!(nearest(&self); [F32, F64])
unary_match!(round_ties_even(&self); [F32, F64])
}
fn add_sat(self, other: Self) -> ValueResult<Self> {