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

Unified Diff: src/IceUtils.h

Issue 1438773004: Subzero. ARM32. Improve constant lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceUtils.h
diff --git a/src/IceUtils.h b/src/IceUtils.h
index 9387671fa21b5a54e6cf9d5b654dbd1b6b0fd89a..0080a11b87f051691f176f0cef4aa3dc6a8b4955 100644
--- a/src/IceUtils.h
+++ b/src/IceUtils.h
@@ -16,6 +16,7 @@
#define SUBZERO_SRC_ICEUTILS_H
#include <climits>
+#include <cmath> // std::signbit()
namespace Ice {
@@ -117,6 +118,13 @@ public:
return value;
return (value >> shift) | (value << (32 - shift));
}
+
+ /// Returns true if Val is +0.0. It requires T to be a floating point type.
+ template <typename T> static bool isPositiveZero(T Val) {
+ static_assert(std::is_floating_point<T>::value,
+ "Input type must be floating point");
+ return Val == 0 && !std::signbit(Val);
+ }
};
} // end of namespace Ice
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/64bit.pnacl.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698