projects
/
platform
/
upstream
/
fontconfig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c209d5
)
Use __builtin_popcount() when available (bug #17592)
author
Behdad Esfahbod
<behdad@behdad.org>
Sun, 28 Dec 2008 09:26:26 +0000
(
04:26
-0500)
committer
Behdad Esfahbod
<behdad@behdad.org>
Sat, 14 Feb 2009 00:54:02 +0000
(16:54 -0800)
src/fccharset.c
patch
|
blob
|
history
diff --git
a/src/fccharset.c
b/src/fccharset.c
index
98ced27
..
1891f08
100644
(file)
--- a/
src/fccharset.c
+++ b/
src/fccharset.c
@@
-546,10
+546,14
@@
FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4)
static FcChar32
FcCharSetPopCount (FcChar32 c1)
{
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+ return __builtin_popcount (c1);
+#else
/* hackmem 169 */
FcChar32 c2 = (c1 >> 1) & 033333333333;
c2 = c1 - c2 - ((c2 >> 1) & 033333333333);
return (((c2 + (c2 >> 3)) & 030707070707) % 077);
+#endif
}
FcChar32