diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-08-30 16:21:21 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-30 22:47:02 +0200 |
commit | 2c7e2e351aa2c40daedfd8ddac3ef868ebac0f2c (patch) | |
tree | a6057f628a651397eb5a5e54728e8af6c011f06d /Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp | |
parent | e93c740df5fe50a83b145e58c105ba54aaf67ac6 (diff) | |
download | serenity-2c7e2e351aa2c40daedfd8ddac3ef868ebac0f2c.zip |
LibWasm: Implement fx.nearest using nearbyint() instead of round()
This instruction wants RoundingMode::ToEven, so let's use the correct
function.
Diffstat (limited to 'Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp')
-rw-r--r-- | Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp index a8f0301bdd..d472da2f96 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp @@ -824,7 +824,7 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi case Instructions::f32_trunc.value(): return unary_operation<float, float, Operators::Truncate>(configuration); case Instructions::f32_nearest.value(): - return unary_operation<float, float, Operators::Round>(configuration); + return unary_operation<float, float, Operators::NearbyIntegral>(configuration); case Instructions::f32_sqrt.value(): return unary_operation<float, float, Operators::SquareRoot>(configuration); case Instructions::f32_add.value(): @@ -852,7 +852,7 @@ void BytecodeInterpreter::interpret(Configuration& configuration, InstructionPoi case Instructions::f64_trunc.value(): return unary_operation<double, double, Operators::Truncate>(configuration); case Instructions::f64_nearest.value(): - return unary_operation<double, double, Operators::Round>(configuration); + return unary_operation<double, double, Operators::NearbyIntegral>(configuration); case Instructions::f64_sqrt.value(): return unary_operation<double, double, Operators::SquareRoot>(configuration); case Instructions::f64_add.value(): |