Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1465)

Unified Diff: test/mjsunit/wasm/float-constant-folding.js

Issue 2662233002: [wasm] Remove x / -1 = -x constant folding for wasm (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/wasm/float-constant-folding.js
diff --git a/test/mjsunit/wasm/float-constant-folding.js b/test/mjsunit/wasm/float-constant-folding.js
index 30757c403d75efb4b95356de2bfd31fc49f0de52..b6ab867c9ed1da6fb270995d53eb7d405b6a43ce 100644
--- a/test/mjsunit/wasm/float-constant-folding.js
+++ b/test/mjsunit/wasm/float-constant-folding.js
@@ -184,6 +184,25 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
})();
(function() {
+ print("F64: sNaN / -1 = qNaN");
+ var builder = new WasmModuleBuilder();
+ builder.addFunction("F64Div1", kSig_i_i)
+ .addBody([
+ kExprI64Const, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf9, 0xff, 0x00,
+ kExprF64ReinterpretI64,
titzer 2017/01/31 17:24:49 Can't this just be a F64Const?
ahaas 2017/01/31 19:43:37 Actually no, for two reasons: 1) Other constant fo
+ kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xbf,
+ kExprF64Div,
+ kExprI64ReinterpretF64,
+ kExprI64Const, 32,
+ kExprI64ShrU,
+ kExprI32ConvertI64,
+ ])
+ .exportFunc();
+ var module = builder.instantiate();
+ assertEquals(0x7ffa0000, module.exports.F64Div1());
+})();
+
+(function() {
print("F64: X / sNaN = qNaN");
var builder = new WasmModuleBuilder();
builder.addFunction("F64XDivNaN", kSig_i_i)
« src/compiler/machine-operator-reducer.cc ('K') | « src/compiler/machine-operator-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698