WebAssembly: Fix f32.min, f64.min and f64.max operations on NaN
authortzagallo@apple.com <tzagallo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 19:29:02 +0000 (19:29 +0000)
committertzagallo@apple.com <tzagallo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 19:29:02 +0000 (19:29 +0000)
commitf25c365867207f08fb338c6e4a19823de31a6f68
tree7a992355b7caebab24972d2adbff7c68d00a939f
parenta778c805eb422cc2c3c8aeeb8409d6c09beb443b
WebAssembly: Fix f32.min, f64.min and f64.max operations on NaN
https://bugs.webkit.org/show_bug.cgi?id=196217

Reviewed by Saam Barati.

JSTests:

Re-enable all NaN tests for f32.min, f64.min and f64.max.

* wasm/spec-tests/f32.wast.js:
* wasm/spec-tests/f64.wast.js:
* wasm/wasm.json:

Source/JavaScriptCore:

Generalize the fix for f32.max to properly handle NaN by doing an extra GreatherThan
comparison in r243446 to all min and max float operations.

* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Min>):
(JSC::Wasm::AirIRGenerator::addFloatingPointMinOrMax):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F32Max>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Min>):
(JSC::Wasm::AirIRGenerator::addOp<OpType::F64Max>):
* wasm/wasm.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/wasm/spec-tests/f32.wast.js
JSTests/wasm/spec-tests/f64.wast.js
JSTests/wasm/wasm.json
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
Source/JavaScriptCore/wasm/wasm.json