diff options
author | Damjan Marion <damarion@cisco.com> | 2018-05-10 13:40:44 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-05-10 17:16:56 +0000 |
commit | 1105600416e0560cb05120a22e0a2e7359a13665 (patch) | |
tree | acf1df08de42344c380473d81886864e662890cf /src/svm | |
parent | 132dc49ee847a3e3b644de8b36499d73e8a8d37e (diff) |
vppinfra: use count_trailing_zeros in sparse_vec_index
It is much cheaper to use ctzll than to do shift,subtract and mask
in likely case when we are looking for 1st set bit in the uword.
Change-Id: I31954081571978878c7098bafad0c85a91755fa2
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/svm')
-rw-r--r-- | src/svm/svm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/svm/svm.c b/src/svm/svm.c index 16a58fa126a..e3a734cbc84 100644 --- a/src/svm/svm.c +++ b/src/svm/svm.c @@ -83,7 +83,7 @@ svm_get_global_region_base_va () unformat_free (&input); close (fd); - count_leading_zeros (bits, end); + bits = count_leading_zeros (end); bits = 64 - bits; if (bits >= 36 && bits <= 48) return ((1ul << bits) / 4) - (2 * SVM_GLOBAL_REGION_SIZE); |