Index: base/numerics/saturated_arithmetic.h |
diff --git a/base/numerics/saturated_arithmetic.h b/base/numerics/saturated_arithmetic.h |
index 7e24fe3617b127fe6641574271f55d3dbafd5f06..74fbba808d63ad849c6a64a44eef284042bd8ec0 100644 |
--- a/base/numerics/saturated_arithmetic.h |
+++ b/base/numerics/saturated_arithmetic.h |
@@ -56,6 +56,12 @@ ALWAYS_INLINE int32_t SaturatedNegative(int32_t a) { |
return -a; |
} |
+ALWAYS_INLINE int32_t SaturatedAbsolute(int32_t a) { |
+ if (a >= 0) |
+ return a; |
+ return SaturatedNegative(a); |
+} |
+ |
ALWAYS_INLINE int GetMaxSaturatedSetResultForTesting(int fractional_shift) { |
// For C version the set function maxes out to max int, this differs from |
// the ARM asm version, see saturated_arithmetic_arm.h for the equivalent asm |