Nikos Nikoleris has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/19128 )
Change subject: base: Add function to count trailing zeros in a 64-bit
integer
......................................................................
base: Add function to count trailing zeros in a 64-bit integer
Change-Id: Iaad0679b403bc5015ffeacbf7284313e41a36cd0
Signed-off-by: Nikos Nikoleris <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19128
Reviewed-by: Daniel Carvalho <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/base/bitfield.hh
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
Daniel Carvalho: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/bitfield.hh b/src/base/bitfield.hh
index ec1ffce..59b239a 100644
--- a/src/base/bitfield.hh
+++ b/src/base/bitfield.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited
+ * Copyright (c) 2017, 2019 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -293,4 +293,15 @@
return value ? __builtin_ctz(value) : 32;
}
+/**
+ * Count trailing zeros in a 64-bit value.
+ *
+ * @param An input value
+ * @return The number of trailing zeros or 64 if the value is zero.
+ */
+inline int ctz64(uint64_t value)
+{
+ return value ? __builtin_ctzll(value) : 64;
+}
+
#endif // __BASE_BITFIELD_HH__
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19128
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Iaad0679b403bc5015ffeacbf7284313e41a36cd0
Gerrit-Change-Number: 19128
Gerrit-PatchSet: 4
Gerrit-Owner: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev