diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-17 10:49:19 -0800 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-17 12:03:17 -0800 |
commit | 8f668f06ca033e8b4292b4ceeb87f3078a996742 (patch) | |
tree | 8a46134b392d524a9889b3ba948f4f3a6bc90403 /common | |
parent | 558a753d3da5a2243a74b8d4e1c24044bdfb5c2e (diff) | |
download | nextpnr-8f668f06ca033e8b4292b4ceeb87f3078a996742.tar.gz nextpnr-8f668f06ca033e8b4292b4ceeb87f3078a996742.tar.bz2 nextpnr-8f668f06ca033e8b4292b4ceeb87f3078a996742.zip |
Use Bits library for bit instrisics.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/exclusive_state_groups.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/exclusive_state_groups.h b/common/exclusive_state_groups.h index 548dfe4b..c9b0df66 100644 --- a/common/exclusive_state_groups.h +++ b/common/exclusive_state_groups.h @@ -24,6 +24,8 @@ #error Include after "nextpnr.h" only. #endif +#include "bits.h" + NEXTPNR_NAMESPACE_BEGIN // Implementation for exclusive state groups, used to implement generic @@ -103,10 +105,10 @@ template <size_t StateCount, typename StateType = int8_t, typename CountType = u // Check whether the state group is now unselected or satified. auto value = selected_states.to_ulong(); - auto number_selected = __builtin_popcount(value); + auto number_selected = nextpnr::Bits::popcount(value); if (number_selected == 1) { // Group is no longer overconstrained. - state = __builtin_ctz(value); + state = nextpnr::Bits::ctz(value); NPNR_ASSERT(selected_states[state]); } else if (number_selected == 0) { // Group is unselected. |