public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gap-pkg-guava] rawhide: Fix popcount use on ppc64le
@ 2026-09-20 15:01 Jerry James
0 siblings, 0 replies; only message in thread
From: Jerry James @ 2026-09-20 15:01 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/gap-pkg-guava
Branch : rawhide
Commit : d025d72ab65783aa724ddf65315b31bb4ad7c52f
Author : Jerry James <loganjerry@gmail.com>
Date : 2026-09-20T09:01:25-06:00
Stats : +25/-36 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/gap-pkg-guava/c/d025d72ab65783aa724ddf65315b31bb4ad7c52f?branch=rawhide
Log:
Fix popcount use on ppc64le
- Use native popcount on more architectures
---
diff --git a/gap-pkg-guava-popcount.patch b/gap-pkg-guava-popcount.patch
index 4dccbba..8616af5 100644
--- a/gap-pkg-guava-popcount.patch
+++ b/gap-pkg-guava-popcount.patch
@@ -1,28 +1,27 @@
---- src/ctjhai/config.h.orig 2023-01-03 09:30:10.000000000 -0700
-+++ src/ctjhai/config.h 2023-08-11 09:16:06.987030975 -0600
-@@ -45,6 +45,10 @@
+--- src/ctjhai/config.h.orig 2026-09-19 10:17:01.000000000 -0600
++++ src/ctjhai/config.h 2026-09-20 08:39:03.323007567 -0600
+@@ -45,6 +45,7 @@
#endif /* BITS_PER_LONG */
#define BITSIZE BITS_PER_LONG
-+#if defined(__i686__) || defined(__x86_64__)
+-#define POPCOUNT_LUT16 1
++// #define POPCOUNT_LUT16 1
+#define POPCOUNT_STD 1
-+#else
- #define POPCOUNT_LUT16 1
-+#endif
#endif
---- src/ctjhai/popcount.c.orig 2023-01-03 09:30:10.000000000 -0700
-+++ src/ctjhai/popcount.c 2023-08-11 09:18:36.582993509 -0600
-@@ -64,7 +64,7 @@ void __clear_popcount_LUT() {
+--- src/ctjhai/popcount.c.orig 2026-09-19 10:17:01.000000000 -0600
++++ src/ctjhai/popcount.c 2026-09-20 08:40:07.106264963 -0600
+@@ -64,7 +64,8 @@ void __clear_popcount_LUT() {
/* Population count function */
#if POPCOUNT_STD
-unsigned int popcount(unsigned long x) {
++#if defined(__x86_64__)
+static unsigned int slow_popcount(unsigned long x) {
#if BITS_PER_LONG == 32
x -= (x>>1) & 0x55555555UL;
x = ((x>>2) & 0x33333333UL) + (x & 0x33333333UL);
-@@ -79,4 +79,19 @@ unsigned int popcount(unsigned long x) {
+@@ -79,4 +80,20 @@ unsigned int popcount(unsigned long x) {
return x>>56;
#endif /* BITS_PER_LONG */
}
@@ -41,28 +40,20 @@
+
+unsigned int __attribute__((ifunc ("resolve_popcount")))
+popcount(unsigned long x);
++#endif
#endif /* POPCOUNT_STD */
---- src/ctjhai/popcount.h.orig 2023-01-03 09:30:10.000000000 -0700
-+++ src/ctjhai/popcount.h 2023-08-11 09:16:06.987030975 -0600
-@@ -30,7 +30,9 @@ void __clear_popcount_LUT();
-
- /* The following contains the macros that actually do the population count */
- #if defined(POPCOUNT_LUT8) /* 8-bit LUT */
--# if BITS_PER_LONG == 64 /* 64-bit machine */
-+# if defined(__powerpc__)
-+# define popcount(__v) __builtin_popcount(__v)
-+# elif BITS_PER_LONG == 64 /* 64-bit machine */
- # define popcount(__v) (__popcnt_LUT[__v & 0xFFUL] + __popcnt_LUT[(__v>>8) & 0xFFUL] + \
- __popcnt_LUT[(__v>>16) & 0xFFUL] + __popcnt_LUT[(__v>>24) & 0xFFUL] + \
- __popcnt_LUT[(__v>>32) & 0xFFUL] + __popcnt_LUT[(__v>>40) & 0xFFUL] + \
-@@ -40,7 +42,9 @@ void __clear_popcount_LUT();
- __popcnt_LUT[(__v>>16) & 0xFFU] + __popcnt_LUT[(__v>>24) & 0xFFU])
+--- src/ctjhai/popcount.h.orig 2026-09-19 10:17:01.000000000 -0600
++++ src/ctjhai/popcount.h 2026-09-20 08:53:46.153493148 -0600
+@@ -47,7 +47,11 @@ void __clear_popcount_LUT(void);
+ # define popcount(__v) (__popcnt_LUT[__v & 0xFFFFU] + __popcnt_LUT[(__v>>16) & 0xFFFFU])
# endif
- #elif defined(POPCOUNT_LUT16) /* 16-bit LUT */
--# if BITS_PER_LONG == 64 /* 64-bit machine */
-+# if defined(__powerpc__)
-+# define popcount(__v) __builtin_popcount(__v)
-+# elif BITS_PER_LONG == 64 /* 64-bit machine */
- # define popcount(__v) (__popcnt_LUT[__v & 0xFFFFUL] + __popcnt_LUT[(__v>>16) & 0xFFFFUL] + \
- __popcnt_LUT[(__v>>32) & 0xFFFFUL] + __popcnt_LUT[(__v>>48) & 0xFFFFUL])
- # else /* 32-bit machine */
+ #elif defined(POPCOUNT_STD)
+- unsigned int popcount(unsigned long x);
++# if defined(__x86_64__)
++ unsigned int popcount(unsigned long x);
++# else
++# define popcount(__v) __builtin_popcountl(__v)
++# endif
+ #endif
+
+ #endif /* _POPCOUNT_H */
diff --git a/gap-pkg-guava.spec b/gap-pkg-guava.spec
index af85e0c..a7ab8a6 100644
--- a/gap-pkg-guava.spec
+++ b/gap-pkg-guava.spec
@@ -21,8 +21,6 @@ BuildSystem: gap
BuildOption(install): bin lib tbl tst
BuildOption(check): tst/testall.g
-BuildRequires: autoconf
-BuildRequires: automake
BuildRequires: gap(autodoc) >= 2019.04.10
BuildRequires: gap(sonata) >= 2.3
BuildRequires: gap-devel >= 4.11
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-20 15:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 15:01 [rpms/gap-pkg-guava] rawhide: Fix popcount use on ppc64le Jerry James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox