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

Unified Diff: test/mjsunit/compiler/multiply-add.js

Issue 11293061: Emit VMLA for multiply-add on ARM (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 1 month 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 | « test/cctest/test-disasm-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/multiply-add.js
diff --git a/test/mjsunit/compiler/regress-const.js b/test/mjsunit/compiler/multiply-add.js
similarity index 61%
copy from test/mjsunit/compiler/regress-const.js
copy to test/mjsunit/compiler/multiply-add.js
index aa55d0fd3ae17051a084a6bf28c2257f2abc8495..2b4304e845eecff29bf0c0a5c63c14700eb5290f 100644
--- a/test/mjsunit/compiler/regress-const.js
+++ b/test/mjsunit/compiler/multiply-add.js
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -26,43 +26,44 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
+// Test expressions that can be computed with a multiply-add instruction.
-// Test const initialization and assignments.
-function f() {
- var x = 42;
- while (true) {
- const y = x;
- if (--x == 0) return y;
- }
+function f(a, b, c) {
+ return a * b + c;
}
-function g() {
- const x = 42;
- x += 1;
- return x;
+function g(a, b, c) {
+ return a + b * c;
}
-for (var i = 0; i < 5; i++) {
- f();
- g();
+function h(a, b, c, d) {
+ return a * b + c * d;
}
+assertEquals(5, f(1, 2, 3));
+assertEquals(5, f(1, 2, 3));
%OptimizeFunctionOnNextCall(f);
-%OptimizeFunctionOnNextCall(g);
-
-assertEquals(42, f());
-assertEquals(42, g());
-
-
-function h(a, b) {
- var r = a + b;
- const X = 42;
- return r + X;
-}
+assertEquals(5, f(1, 2, 3));
+assertEquals("2foo", f(1, 2, "foo"));
+assertEquals(5.41, f(1.1, 2.1, 3.1));
+assertEquals(5.41, f(1.1, 2.1, 3.1));
+%OptimizeFunctionOnNextCall(f);
+assertEquals(5.41, f(1.1, 2.1, 3.1));
-for (var i = 0; i < 5; i++) h(1,2);
+assertEquals(7, g(1, 2, 3));
+assertEquals(7, g(1, 2, 3));
+%OptimizeFunctionOnNextCall(g);
+assertEquals(7, g(1, 2, 3));
+assertEquals(8.36, g(1.1, 2.2, 3.3));
+assertEquals(8.36, g(1.1, 2.2, 3.3));
+%OptimizeFunctionOnNextCall(g);
+assertEquals(8.36, g(1.1, 2.2, 3.3));
+assertEquals(14, h(1, 2, 3, 4));
+assertEquals(14, h(1, 2, 3, 4));
%OptimizeFunctionOnNextCall(h);
-
-assertEquals(45, h(1,2));
-assertEquals("foo742", h("foo", 7));
+assertEquals(14, h(1, 2, 3, 4));
+assertEquals(15.02, h(1.1, 2.1, 3.1, 4.1));
+assertEquals(15.02, h(1.1, 2.1, 3.1, 4.1));
+%OptimizeFunctionOnNextCall(h);
+assertEquals(15.02, h(1.1, 2.1, 3.1, 4.1));
« no previous file with comments | « test/cctest/test-disasm-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698