Path: blob/main/astro/oskar/files/patch-extern_Random123_features_gccfeatures.h
16461 views
--- extern/Random123/features/gccfeatures.h.orig 2019-11-17 00:45:21 UTC1+++ extern/Random123/features/gccfeatures.h2@@ -60,7 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O3Please let the authors know of any successes (or failures). */4#endif56-#ifdef __powerpc__7+#if defined(__powerpc__) && !defined(__clang__)8#include <ppu_intrinsics.h>9#endif1011@@ -246,6 +246,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O12#else13#define R123_USE_MULHILO64_MULHI_INTRIN 014#endif15+#endif16+17+#if defined(__powerpc__) && defined(__clang__)18+#ifdef __powerpc64__19+static inline unsigned long long __mulhdu(unsigned long long a, unsigned long long b) {20+ __uint128_t c = (__uint128_t) a * (__uint128_t) b;21+ return c >> 64;22+}23+#endif24+25+static inline unsigned int __mulhwu(unsigned int a, unsigned int b) {26+ unsigned long long c = (unsigned long long) a * (unsigned long long) b;27+ return c >> 32;28+}29#endif3031#ifndef R123_MULHILO64_MULHI_INTRIN323334