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

Unified Diff: test/mjsunit/asm/word32ror.js

Issue 760523004: [turbofan] Recognize rotate right. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactored Word32Or reduction Created 6 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
Index: test/mjsunit/asm/word32ror.js
diff --git a/test/mjsunit/asm/word32ror.js b/test/mjsunit/asm/word32ror.js
index d385eac52eec41c826edc069d45b423bf287ec12..9535bdee8a5e63c60133569200deb0a158339070 100644
--- a/test/mjsunit/asm/word32ror.js
+++ b/test/mjsunit/asm/word32ror.js
@@ -20,3 +20,18 @@ assertEquals(10, rol(10, 0));
assertEquals(2, rol(1, 1));
assertEquals(0x40000000, rol(1, 30));
assertEquals(-0x80000000, rol(1, 31));
+
+var ror = (function Module(stdlib, foreign, heap) {
+ "use asm";
+ function ror(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return (x << (32 - y)) | (x >>> y);
+ }
+ return { ror: ror };
+})(stdlib, foreign, heap).ror;
+
+assertEquals(10, ror(10, 0));
+assertEquals(-0x80000000, ror(1, 1));
+assertEquals(0x40000000, ror(1, 2));
+assertEquals(2, ror(1, 31));
« 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