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

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

Issue 12319113: Emit VMLS for multiply-subtract on ARM. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Ulan's commen Created 7 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 | « 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-sub.js
diff --git a/test/mjsunit/compiler/regress-const.js b/test/mjsunit/compiler/multiply-sub.js
similarity index 72%
copy from test/mjsunit/compiler/regress-const.js
copy to test/mjsunit/compiler/multiply-sub.js
index aa55d0fd3ae17051a084a6bf28c2257f2abc8495..4793181d47a2b4a2b2390f5049758e651ef1ec1c 100644
--- a/test/mjsunit/compiler/regress-const.js
+++ b/test/mjsunit/compiler/multiply-sub.js
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2013 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,31 @@
// 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.41, f(1.1, 2.1, 3.1));
+assertEquals(-5.41, f(1.1, 2.1, 3.1));
%OptimizeFunctionOnNextCall(f);
-%OptimizeFunctionOnNextCall(g);
-
-assertEquals(42, f());
-assertEquals(42, g());
+assertEquals(-5.41, f(1.1, 2.1, 3.1));
+assertEquals(8.36, g(2.2, 3.3, -1.1));
+assertEquals(8.36, g(2.2, 3.3, -1.1));
+%OptimizeFunctionOnNextCall(g);
+assertEquals(8.36, g(2.2, 3.3, -1.1));
-function h(a, b) {
- var r = a + b;
- const X = 42;
- return r + X;
-}
-
-for (var i = 0; i < 5; i++) h(1,2);
-
+assertEquals(-1.5, h(1.5, 3.0, 12, 0.5));
+assertEquals(-1.5, h(1.5, 3.0, 12, 0.5));
%OptimizeFunctionOnNextCall(h);
-
-assertEquals(45, h(1,2));
-assertEquals("foo742", h("foo", 7));
+assertEquals(-1.5, h(1.5, 3.0, 12, 0.5));
« 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