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

Unified Diff: test/mjsunit/asm/uint32-less-than-shift.js

Issue 689883003: Fix bug in optimization of Uint32LessThan. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add TODO(turbofan) Created 6 years, 2 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/asm/uint32-less-than-shift.js
diff --git a/test/mjsunit/asm/uint32-less-than-shift.js b/test/mjsunit/asm/uint32-less-than-shift.js
new file mode 100644
index 0000000000000000000000000000000000000000..7384e21ebd3f366d5ca6d8e78aeaba6ee196f44c
--- /dev/null
+++ b/test/mjsunit/asm/uint32-less-than-shift.js
@@ -0,0 +1,61 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function Module(stdlib, foreign, heap) {
+ 'use asm';
+
+ function foo1(i1) {
+ i1 = i1 | 0;
+ var i10 = i1 >> 5;
+ if (i10 >>> 0 < 5) {
+ return 1;
+ } else {
+ return 0;
+ }
+ return 0;
+ }
+
+ function foo2(i1) {
+ i1 = i1 | 0;
+ var i10 = i1 / 32 | 0;
+ if (i10 >>> 0 < 5) {
+ return 1;
+ } else {
+ return 0;
+ }
+ return 0;
+ }
+
+ function foo3(i1) {
+ i1 = i1 | 0;
+ var i10 = (i1 + 32 | 0) / 32 | 0;
+ if (i10 >>> 0 < 5) {
+ return 1;
+ } else {
+ return 0;
+ }
+ return 0;
+ }
+ return {foo1: foo1, foo2: foo2, foo3: foo3};
+}
+
+var m = Module(this, {}, undefined);
+
+for (var i = 0; i < 4 * 32; i++) {
+ assertEquals(1, m.foo1(i));
+ assertEquals(1, m.foo2(i));
+ assertEquals(1, m.foo3(i));
+}
+
+for (var i = 4 * 32; i < 5 * 32; i++) {
+ assertEquals(1, m.foo1(i));
+ assertEquals(1, m.foo2(i));
+ assertEquals(0, m.foo3(i));
+}
+
+for (var i = 5 * 32; i < 10 * 32; i++) {
+ assertEquals(0, m.foo1(i));
+ assertEquals(0, m.foo2(i));
+ assertEquals(0, m.foo3(i));
+}
« no previous file with comments | « src/compiler/machine-operator-reducer.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698