From 57caf630927f3c94b8ceb97d90f24bc17eb8272f Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Thu, 20 Aug 2020 16:17:34 -0700 Subject: [PATCH] base: Tag API methods in intmath.hh Change-Id: Ia50830c7620380ff2aba081f56f74822aff982bf Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33075 Maintainer: Bobby R. Bruce Tested-by: kokoro Reviewed-by: Bobby R. Bruce Reviewed-by: Jason Lowe-Power --- src/base/intmath.hh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/base/intmath.hh b/src/base/intmath.hh index 3713ae624..daf5f5d97 100644 --- a/src/base/intmath.hh +++ b/src/base/intmath.hh @@ -36,6 +36,9 @@ #include "base/logging.hh" #include "base/types.hh" +/** + * @ingroup api_base_utils + */ inline uint64_t power(uint32_t n, uint32_t e) { @@ -52,6 +55,9 @@ power(uint32_t n, uint32_t e) return result; } +/** + * @ingroup api_base_utils + */ template inline typename std::enable_if::value, int>::type floorLog2(T x) @@ -74,6 +80,9 @@ floorLog2(T x) return y; } +/** + * @ingroup api_base_utils + */ template inline int ceilLog2(const T& n) @@ -85,6 +94,9 @@ ceilLog2(const T& n) return floorLog2(n - (T)1) + 1; } +/** + * @ingroup api_base_utils + */ template inline bool isPowerOf2(const T& n) @@ -94,6 +106,9 @@ isPowerOf2(const T& n) return n && !(n & (n - 1)); } +/** + * @ingroup api_base_utils + */ template inline T divCeil(const T& a, const U& b) @@ -108,7 +123,9 @@ divCeil(const T& a, const U& b) * @param align is the alignment. Can only be a power of 2. * @return The aligned address. The smallest number divisible * by @param align which is greater than or equal to @param val. -*/ + * + * @ingroup api_base_utils + */ template inline T roundUp(const T& val, const U& align) @@ -125,7 +142,9 @@ roundUp(const T& val, const U& align) * @param align is the alignment. Can only be a power of 2. * @return The aligned address. The biggest number divisible * by @param align which is less than or equal to @param val. -*/ + * + * @ingroup api_base_utils + */ template inline T roundDown(const T& val, const U& align) -- 2.30.2