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

Unified Diff: src/base/bits.cc

Issue 648283002: [arm] Add support for SMMLA, SMMLS and SMMUL. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Fix 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
« no previous file with comments | « src/base/bits.h ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/bits.cc
diff --git a/src/base/bits.cc b/src/base/bits.cc
index 6daee532a74cf7e5a0e0022afe70f453eb0e3ad3..7a3fb6d33159dfd64c88fb16683aabf2248f05a8 100644
--- a/src/base/bits.cc
+++ b/src/base/bits.cc
@@ -20,6 +20,25 @@ uint32_t RoundUpToPowerOfTwo32(uint32_t value) {
return value + 1;
}
+
+int32_t SignedMulHigh32(int32_t lhs, int32_t rhs) {
+ int64_t const value = static_cast<int64_t>(lhs) * static_cast<int64_t>(rhs);
+ return bit_cast<int32_t, uint32_t>(bit_cast<uint64_t>(value) >> 32u);
+}
+
+
+int32_t SignedMulHighAndAdd32(int32_t lhs, int32_t rhs, int32_t acc) {
+ return bit_cast<int32_t>(bit_cast<uint32_t>(acc) +
+ bit_cast<uint32_t>(SignedMulHigh32(lhs, rhs)));
+}
+
+
+int32_t SignedMulHighAndSub32(int32_t lhs, int32_t rhs, int32_t acc) {
+ return bit_cast<int32_t>(bit_cast<uint32_t>(acc) -
+ bit_cast<uint32_t>(SignedMulHigh32(lhs, rhs)));
+}
+
+
} // namespace bits
} // namespace base
} // namespace v8
« no previous file with comments | « src/base/bits.h ('k') | test/cctest/test-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698