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

Unified Diff: src/IceUtils.h

Issue 1127963004: Subzero ARM: lowerArguments (GPR), basic legalize(), and lowerRet(i32, i64). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: clang-format Created 5 years, 7 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: src/IceUtils.h
diff --git a/src/IceUtils.h b/src/IceUtils.h
index bcbba23eeab4bc441d63e616fd5cd7ee54bc528b..cf0be63364f2eb1052073c9c501fec60d538881e 100644
--- a/src/IceUtils.h
+++ b/src/IceUtils.h
@@ -78,6 +78,19 @@ public:
return 0;
return Align - Mod;
}
+
+ // Precondition: 0 <= shift < 32
jvoung (off chromium) 2015/05/14 22:42:07 borrowed from V8 basically
+ static inline uint32_t rotateLeft32(uint32_t value, uint32_t shift) {
+ if (shift == 0)
+ return value;
+ return (value << shift) | (value >> (32 - shift));
+ }
+
+ static inline uint32_t rotateRight32(uint32_t value, uint32_t shift) {
+ if (shift == 0)
+ return value;
+ return (value >> shift) | (value << (32 - shift));
+ }
};
} // end of namespace Ice

Powered by Google App Engine
This is Rietveld 408576698