Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
16461 views
1
--- extern/Random123/features/gccfeatures.h.orig 2019-11-17 00:45:21 UTC
2
+++ extern/Random123/features/gccfeatures.h
3
@@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
4
Please let the authors know of any successes (or failures). */
5
#endif
6
7
-#ifdef __powerpc__
8
+#if defined(__powerpc__) && !defined(__clang__)
9
#include <ppu_intrinsics.h>
10
#endif
11
12
@@ -246,6 +246,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
13
#else
14
#define R123_USE_MULHILO64_MULHI_INTRIN 0
15
#endif
16
+#endif
17
+
18
+#if defined(__powerpc__) && defined(__clang__)
19
+#ifdef __powerpc64__
20
+static inline unsigned long long __mulhdu(unsigned long long a, unsigned long long b) {
21
+ __uint128_t c = (__uint128_t) a * (__uint128_t) b;
22
+ return c >> 64;
23
+}
24
+#endif
25
+
26
+static inline unsigned int __mulhwu(unsigned int a, unsigned int b) {
27
+ unsigned long long c = (unsigned long long) a * (unsigned long long) b;
28
+ return c >> 32;
29
+}
30
#endif
31
32
#ifndef R123_MULHILO64_MULHI_INTRIN
33
34