summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-12-14 13:35:28 -0800
committer buzbee <buzbee@google.com> 2013-02-06 12:16:33 -0800
commit4ef3e45d7c6ec3c482a1a48f4df470811aa3cf0a (patch)
tree5d91ff23708048a2b453a5917dab82be1b545f91 /src/utils.h
parentf84f99fe3a944310fdfb6f17836079ac5c48c799 (diff)
Compiler constant handling rework
In preparation for de-optimization, reworked the constant handling mechanism. Also took advantage of knowledge of constant operands (particularly for long operations). Significant performance improvements for Mandelbrot (~60 seconds to ~34 seconds). Minor improvements in other benchmarks. The new constant handling breaks two of the existing optimization passes: "Skip Large Method" and "Load/Store Elimization." I don't intend to update the large method optimization because it will be superceeded by the upcoming interpreter/ fingerprinting mechanism. Leaving the code in place for now in order to compare compile-time improvements with fingerprinting/interpret. All related code will be deleted when that is complete. The load/store elimination pass needs some rework to handle uses of multiple-register loads and stores. It will be updated & restored in a future CL. Change-Id: Ia979abaf51b8ae81bbb0428031cbcea854625fac
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/utils.h b/src/utils.h
index f3c9b7a10a..d808fc3f24 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -91,20 +91,20 @@ static inline bool IsAbsoluteUint(int N, word value) {
return IsUint(N, value);
}
-static inline int32_t Low16Bits(int32_t value) {
- return static_cast<int32_t>(value & 0xffff);
+static inline uint16_t Low16Bits(uint32_t value) {
+ return static_cast<uint16_t>(value);
}
-static inline int32_t High16Bits(int32_t value) {
- return static_cast<int32_t>(value >> 16);
+static inline uint16_t High16Bits(uint32_t value) {
+ return static_cast<uint16_t>(value >> 16);
}
-static inline int32_t Low32Bits(int64_t value) {
- return static_cast<int32_t>(value);
+static inline uint32_t Low32Bits(uint64_t value) {
+ return static_cast<uint32_t>(value);
}
-static inline int32_t High32Bits(int64_t value) {
- return static_cast<int32_t>(value >> 32);
+static inline uint32_t High32Bits(uint64_t value) {
+ return static_cast<uint32_t>(value >> 32);
}
template<typename T>