Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2024 05:18:59 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 0708acd3c9f1 - main - comms/liquid-dsp: fix build on powerpc*
Message-ID:  <202406200518.45K5IxdI082676@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0708acd3c9f1a641133061873750efe94ee624b0

commit 0708acd3c9f1a641133061873750efe94ee624b0
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2024-06-19 16:49:56 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2024-06-20 05:18:31 +0000

    comms/liquid-dsp: fix build on powerpc*
    
    cc: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
---
 comms/liquid-dsp/files/patch-configure.ac          | 11 +++++
 .../files/patch-src_dotprod_src_dotprod__crcf.av.c | 39 ++++++++++++++++++
 .../files/patch-src_dotprod_src_dotprod__rrrf.av.c | 48 ++++++++++++++++++++++
 3 files changed, 98 insertions(+)

diff --git a/comms/liquid-dsp/files/patch-configure.ac b/comms/liquid-dsp/files/patch-configure.ac
new file mode 100644
index 000000000000..067e30f1e5ee
--- /dev/null
+++ b/comms/liquid-dsp/files/patch-configure.ac
@@ -0,0 +1,11 @@
+--- configure.ac.orig	2024-06-19 10:43:23 UTC
++++ configure.ac
+@@ -228,7 +228,7 @@ else
+                        src/dotprod/src/dotprod_rrrf.av.o \
+                        src/dotprod/src/dotprod_crcf.av.o \
+                        src/dotprod/src/sumsq.o"
+-        ARCH_OPTION="-fno-common -faltivec";;
++        ARCH_OPTION="-fno-common -maltivec";;
+     armv1*|armv2*|armv3*|armv4*|armv5*|armv6*)
+         # assume neon instructions are NOT available
+         MLIBS_DOTPROD="src/dotprod/src/dotprod_cccf.o \
diff --git a/comms/liquid-dsp/files/patch-src_dotprod_src_dotprod__crcf.av.c b/comms/liquid-dsp/files/patch-src_dotprod_src_dotprod__crcf.av.c
new file mode 100644
index 000000000000..ee33f55d4bdb
--- /dev/null
+++ b/comms/liquid-dsp/files/patch-src_dotprod_src_dotprod__crcf.av.c
@@ -0,0 +1,39 @@
+--- src/dotprod/src/dotprod_crcf.av.c.orig	2024-06-19 07:24:39 UTC
++++ src/dotprod/src/dotprod_crcf.av.c
+@@ -26,6 +26,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <altivec.h>
+ 
+ #include "liquid.internal.h"
+ 
+@@ -195,8 +196,8 @@ int dotprod_crcf_execute(dotprod_crcf    _q,
+     union { vector float v; float w[4];} s;
+     unsigned int nblocks;
+ 
+-    ar = (vector float*)( (int)_x & ~15);
+-    al = ((int)_x & 15)/sizeof(float);
++    ar = (vector float*)( (uintptr_t)_x & ~15);
++    al = ((uintptr_t)_x & 15)/sizeof(float);
+ 
+     d = (vector float*)_q->h[al];
+ 
+@@ -206,7 +207,7 @@ int dotprod_crcf_execute(dotprod_crcf    _q,
+     // split into four vectors each with four 32-bit
+     // partial sums.  Effectively each loop iteration
+     // operates on 16 input samples at a time.
+-    s0 = s1 = s2 = s3 = (vector float)(0);
++    s0 = s1 = s2 = s3 = (vector float){0,0,0,0};
+     while (nblocks >= 4) {
+         s0 = vec_madd(ar[nblocks-1],d[nblocks-1],s0);
+         s1 = vec_madd(ar[nblocks-2],d[nblocks-2],s1);
+@@ -227,7 +228,7 @@ int dotprod_crcf_execute(dotprod_crcf    _q,
+     // move the result into the union s (effetively,
+     // this loads the four 32-bit values in s0 into
+     // the array w).
+-    s.v = vec_add(s0,(vector float)(0));
++    s.v = vec_add(s0,(vector float){0,0,0,0});
+ 
+     // sum the resulting array
+     //*_r = s.w[0] + s.w[1] + s.w[2] + s.w[3];
diff --git a/comms/liquid-dsp/files/patch-src_dotprod_src_dotprod__rrrf.av.c b/comms/liquid-dsp/files/patch-src_dotprod_src_dotprod__rrrf.av.c
new file mode 100644
index 000000000000..380885fd00a1
--- /dev/null
+++ b/comms/liquid-dsp/files/patch-src_dotprod_src_dotprod__rrrf.av.c
@@ -0,0 +1,48 @@
+--- src/dotprod/src/dotprod_rrrf.av.c.orig	2024-06-19 07:25:01 UTC
++++ src/dotprod/src/dotprod_rrrf.av.c
+@@ -26,6 +26,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <altivec.h>
+ 
+ #include "liquid.internal.h"
+ 
+@@ -117,7 +118,7 @@ dotprod_rrrf dotprod_rrrf_create_opt(float *      _h,
+     for (i=0; i<4; i++) {
+         q->h[i] = calloc(1+(q->n+i-1)/4,sizeof(vector float));
+         for (j=0; j<q->n; j++)
+-            e->h[i][j+i] = _h[_rev ? q->n-j-1 : j];
++            q->h[i][j+i] = _h[_rev ? q->n-j-1 : j];
+     }
+ 
+     return q;
+@@ -190,8 +191,8 @@ int dotprod_rrrf_execute(dotprod_rrrf _q,
+     union { vector float v; float w[4];} s;
+     unsigned int nblocks;
+ 
+-    ar = (vector float*)( (int)_x & ~15);
+-    al = ((int)_x & 15)/sizeof(float);
++    ar = (vector float*)( (uintptr_t)_x & ~15);
++    al = ((uintptr_t)_x & 15)/sizeof(float);
+ 
+     d = (vector float*)_q->h[al];
+ 
+@@ -200,7 +201,7 @@ int dotprod_rrrf_execute(dotprod_rrrf _q,
+     // split into four vectors each with four 32-bit
+     // partial sums.  Effectively each loop iteration
+     // operates on 16 input samples at a time.
+-    s0 = s1 = s2 = s3 = (vector float)(0);
++    s0 = s1 = s2 = s3 = (vector float){0,0,0,0};
+     while (nblocks >= 4) {
+         s0 = vec_madd(ar[nblocks-1],d[nblocks-1],s0);
+         s1 = vec_madd(ar[nblocks-2],d[nblocks-2],s1);
+@@ -221,7 +222,7 @@ int dotprod_rrrf_execute(dotprod_rrrf _q,
+     // move the result into the union s (effetively,
+     // this loads the four 32-bit values in s0 into
+     // the array w).
+-    s.v = vec_add(s0,(vector float)(0));
++    s.v = vec_add(s0,(vector float){0,0,0,0});
+ 
+     // sum the resulting array
+     *_r = s.w[0] + s.w[1] + s.w[2] + s.w[3];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406200518.45K5IxdI082676>