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

Unified Diff: src/utils.h

Issue 15769010: Improve code for integral modulus calculation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 7 years, 6 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/mips/lithium-mips.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index 5680384196d2c870cd519f420d34bb84337fb881..4a08319044bf7f0768970f539a1a41ac3f298747 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -251,6 +251,13 @@ T Min(T a, T b) {
}
+// Returns the absolute value of its argument.
+template <typename T>
+T Abs(T a) {
+ return a < 0 ? -a : a;
+}
+
+
// Returns the negative absolute value of its argument.
template <typename T>
T NegAbs(T a) {
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698