git: ac19aed05816 - main - science/cdo: fix build on powerpc64le with LLVM 13.0.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 29 Mar 2022 06:25:09 UTC
The branch main has been updated by pkubaj:
URL: https://cgit.FreeBSD.org/ports/commit/?id=ac19aed05816d6ee531c28d1fc19bff821c59e8c
commit ac19aed05816d6ee531c28d1fc19bff821c59e8c
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-03-29 06:14:10 +0000
Commit: Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-03-29 06:14:10 +0000
science/cdo: fix build on powerpc64le with LLVM 13.0.0
Same as science/cgribex:
cgribexlib.c:766:2: error: address of register variable requested
dmin[j] = data[0];
---
science/cdo/files/patch-libcdi_src_cgribexlib.c | 57 ++++++++++++++++---------
1 file changed, 38 insertions(+), 19 deletions(-)
diff --git a/science/cdo/files/patch-libcdi_src_cgribexlib.c b/science/cdo/files/patch-libcdi_src_cgribexlib.c
index 11aaf5c127f6..904c7971669d 100644
--- a/science/cdo/files/patch-libcdi_src_cgribexlib.c
+++ b/science/cdo/files/patch-libcdi_src_cgribexlib.c
@@ -9,23 +9,42 @@
#pragma options nostrict
#include <ppu_intrinsics.h>
#endif
-@@ -734,6 +734,19 @@ void sse2_minmax_val_double(const double *restrict buf
- #endif // SIMD
+@@ -745,8 +745,8 @@ void pwr6_minmax_val_double_unrolled6(const double *re
+ size_t i, j;
+ size_t residual = datasize % __UNROLL_DEPTH_1;
+ size_t ofs = datasize - residual;
+- double register dmin[__UNROLL_DEPTH_1];
+- double register dmax[__UNROLL_DEPTH_1];
++ double dmin[__UNROLL_DEPTH_1];
++ double dmax[__UNROLL_DEPTH_1];
- #if defined(_ARCH_PWR6)
-+
-+#ifndef __fsel
-+static __inline__ double __fsel(double x, double y, double z)
-+ __attribute__((always_inline));
-+static __inline__ double
-+__fsel(double x, double y, double z)
-+{
-+ double r;
-+ __asm__("fsel %0,%1,%2,%3" : "=d"(r) : "d"(x),"d"(y),"d"(z));
-+ return r;
-+}
-+#endif
-+
- static
- void pwr6_minmax_val_double_unrolled6(const double *restrict data, size_t datasize, double *fmin, double *fmax)
- {
+ for ( j = 0; j < __UNROLL_DEPTH_1; j++)
+ {
+@@ -758,21 +758,21 @@ void pwr6_minmax_val_double_unrolled6(const double *re
+ {
+ for (j = 0; j < __UNROLL_DEPTH_1; j++)
+ {
+- dmin[j] = __fsel(dmin[j] - data[i+j], data[i+j], dmin[j]);
+- dmax[j] = __fsel(data[i+j] - dmax[j], data[i+j], dmax[j]);
++ dmin[j] = __builtin_ppc_fsel(dmin[j] - data[i+j], data[i+j], dmin[j]);
++ dmax[j] = __builtin_ppc_fsel(data[i+j] - dmax[j], data[i+j], dmax[j]);
+ }
+ }
+
+ for (j = 0; j < residual; j++)
+ {
+- dmin[j] = __fsel(dmin[j] - data[ofs+j], data[ofs+j], dmin[j]);
+- dmax[j] = __fsel(data[ofs+j] - dmax[j], data[ofs+j], dmax[j]);
++ dmin[j] = __builtin_ppc_fsel(dmin[j] - data[ofs+j], data[ofs+j], dmin[j]);
++ dmax[j] = __builtin_ppc_fsel(data[ofs+j] - dmax[j], data[ofs+j], dmax[j]);
+ }
+
+ for ( j = 0; j < __UNROLL_DEPTH_1; j++)
+ {
+- *fmin = __fsel(*fmin - dmin[j], dmin[j], *fmin);
+- *fmax = __fsel(dmax[j] - *fmax, dmax[j], *fmax);
++ *fmin = __builtin_ppc_fsel(*fmin - dmin[j], dmin[j], *fmin);
++ *fmax = __builtin_ppc_fsel(dmax[j] - *fmax, dmax[j], *fmax);
+ }
+ }
+ #undef __UNROLL_DEPTH_1