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

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

Issue 2662233002: [wasm] Remove x / -1 = -x constant folding for wasm (Closed)
Patch Set: Rebase Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8e9d65320a830569501a91b822cab38f26fa4e62..5c23ac376839cc5969ca13f5860b86e230ac5695 100644
--- a/test/mjsunit/wasm/float-constant-folding.js
+++ b/test/mjsunit/wasm/float-constant-folding.js
@@ -239,6 +239,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,
+ 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698