X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flibpspp%2Fsparse-array.c;h=6471bbacf44a83ad919477c35d5c7b6b2ed1a37d;hb=ccead09ac2bc67bbaa40e67904f6c48f7cdf6700;hp=7af219bcb080cd0a75b8b6bf9f823d2f397618a1;hpb=c4b4f06dbfcff9582548a72d4e9ca0ffc90077fc;p=pspp-builds.git diff --git a/src/libpspp/sparse-array.c b/src/libpspp/sparse-array.c index 7af219bc..6471bbac 100644 --- a/src/libpspp/sparse-array.c +++ b/src/libpspp/sparse-array.c @@ -447,6 +447,9 @@ unset_in_use (struct leaf_node *leaf, unsigned int key) static inline int count_trailing_zeros (unsigned long int x) { +#if __GNUC__ >= 4 + return __builtin_ctzl (x); +#else /* not GCC 4+ */ /* This algorithm is from _Hacker's Delight_ section 5.4. */ int n = 1; @@ -469,6 +472,7 @@ count_trailing_zeros (unsigned long int x) COUNT_STEP (2); return n - (x & 1); +#endif /* not GCC 4+ */ } /* Returns the least index of the in-use element in LEAF greater