WebAssembly: f32.max with NaN generates incorrect result
authortzagallo@apple.com <tzagallo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Mar 2019 19:11:31 +0000 (19:11 +0000)
committertzagallo@apple.com <tzagallo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Mar 2019 19:11:31 +0000 (19:11 +0000)
commitf9b71ca8fbd75d41d6cb7186226dc2fb559db625
tree3e2e2bd3611d0649fdd1556460380f6908187e0e
parentb2a8efc808cef6febbba8cf9a59107ebd3966074
WebAssembly: f32.max with NaN generates incorrect result
https://bugs.webkit.org/show_bug.cgi?id=175691
<rdar://problem/33952228>

Reviewed by Saam Barati.

JSTests:

Enable all f32.max NaN tests

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

Source/JavaScriptCore:

Fix the B3 and Air compilation for f32.max. In order to handle the NaN
case, we need an extra GreaterThan comparison on top of the existing
Equal and LessThan ones.

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

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