aboutsummaryrefslogtreecommitdiff
path: root/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2019-11-17 19:01:58 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2019-11-17 19:01:58 +0000
commit271db6fe4a5029fc3102d92cbc51b4426699425d (patch)
tree17cbe02f0f8748336e2a0d4e2656f398dc2aea0d /astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
parent12eb47590c4c7961890a35b3955aae49c7286958 (diff)
downloadports-271db6fe4a5029fc3102d92cbc51b4426699425d.tar.gz
ports-271db6fe4a5029fc3102d92cbc51b4426699425d.zip
Notes
Diffstat (limited to 'astro/oskar/files/patch-extern_Random123_features_gccfeatures.h')
-rw-r--r--astro/oskar/files/patch-extern_Random123_features_gccfeatures.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h b/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
new file mode 100644
index 000000000000..d7eb4af213fc
--- /dev/null
+++ b/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
@@ -0,0 +1,32 @@
+--- extern/Random123/features/gccfeatures.h.orig 2019-11-17 00:45:21 UTC
++++ extern/Random123/features/gccfeatures.h
+@@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
+ Please let the authors know of any successes (or failures). */
+ #endif
+
+-#ifdef __powerpc__
++#if defined(__powerpc__) && !defined(__clang__)
+ #include <ppu_intrinsics.h>
+ #endif
+
+@@ -246,6 +246,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
+ #else
+ #define R123_USE_MULHILO64_MULHI_INTRIN 0
+ #endif
++#endif
++
++#if defined(__powerpc__) && defined(__clang__)
++#ifdef __powerpc64__
++static inline unsigned long long __mulhdu(unsigned long long a, unsigned long long b) {
++ __uint128_t c = (__uint128_t) a * (__uint128_t) b;
++ return c >> 64;
++}
++#endif
++
++static inline unsigned int __mulhwu(unsigned int a, unsigned int b) {
++ unsigned long long c = (unsigned long long) a * (unsigned long long) b;
++ return c >> 32;
++}
+ #endif
+
+ #ifndef R123_MULHILO64_MULHI_INTRIN