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

Side by Side Diff: test/mjsunit/wasm/asm-wasm.js

Issue 1718083004: Allow constant multiply both ways. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« src/typing-asm.cc ('K') | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 function EmptyTest() { 7 function EmptyTest() {
8 "use asm"; 8 "use asm";
9 function caller() { 9 function caller() {
10 empty(); 10 empty();
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 var a = fround(1.0); 1342 var a = fround(1.0);
1343 var b = fround(2.0); 1343 var b = fround(2.0);
1344 HEAPF32[0] = a + b; 1344 HEAPF32[0] = a + b;
1345 return +HEAPF32[0]; 1345 return +HEAPF32[0];
1346 } 1346 }
1347 return {func: func}; 1347 return {func: func};
1348 } 1348 }
1349 1349
1350 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString()); 1350 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
1351 assertEquals(3, m.func()); 1351 assertEquals(3, m.func());
1352 }) // TODO(bradnelson): Enable when Math.fround implementation lands. 1352 }); // TODO(bradnelson): Enable when Math.fround implementation lands.
1353
1354
1355 (function TestIntegerMultiplyBothWays() {
1356 function Module(stdlib, foreign, heap) {
1357 "use asm";
1358 function func() {
1359 var a = 1;
1360 return ((a * 3) + (4 * a)) | 0;
1361 }
1362 return {func: func};
1363 }
1364
1365 var m = _WASMEXP_.instantiateModuleFromAsm(Module.toString());
1366 assertEquals(7, m.func());
1367 })();
1368
1369
1370 (function TestBadMultiplyIntish() {
1371 function Module(stdlib, foreign, heap) {
1372 "use asm";
1373 function func() {
1374 var a = 1;
1375 return ((a + a) * 4) | 0;
1376 }
1377 return {func: func};
1378 }
1379 assertThrows(function() {
1380 _WASMEXP_.instantiateModuleFromAsm(Module.toString());
1381 });
1382 })();
OLDNEW
« src/typing-asm.cc ('K') | « test/cctest/test-asm-validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698