All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/liquid-dsp: fix x86 builds
@ 2024-01-08 17:32 Fabrice Fontaine
  2024-01-08 21:05 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2024-01-08 17:32 UTC (permalink / raw)
  To: buildroot; +Cc: Guillaume William Brs, Fabrice Fontaine

HAVE_{MMX,SSE2,...} are not defined if ax_cv_have_{i}_cpu_ext is not set
resulting in the following build failure raised since bump to version
1.5.0 in commit c2aaa0fbe2fdf6e599c68169aa7b2e55237190c7 and
https://github.com/jgaeddert/liquid-dsp/commit/02c4e8b99b11d9f1615b8840f243b08a85b86563:

src/dotprod/src/dotprod_cccf.sse.c: In function 'dotprod_cccf_execute_sse':
src/dotprod/src/dotprod_cccf.sse.c:258:5: error: unknown type name '__m128'; did you mean '__int128'?
  258 |     __m128 v;   // input vector
      |     ^~~~~~
      |     __int128

or

src/dotprod/src/dotprod_cccf.mmx.c: In function 'dotprod_cccf_execute_mmx':
src/dotprod/src/dotprod_cccf.mmx.c:262:5: error: unknown type name '__m128'; did you mean '__int128'?
  262 |     __m128 v;   // input vector
      |     ^~~~~~
      |     __int128

While at it, add AVX2 support and drop options which had no effect
(MMX, SSE, SSE42 and SSSE3)

Fixes:
 - http://autobuild.buildroot.org/results/738ce9d3dc74ec165391f21256c955e5524f1632
 - http://autobuild.buildroot.org/results/a2d150c724ab6787aeabaf31f65116f802e8584e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/liquid-dsp/liquid-dsp.mk | 40 ++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/package/liquid-dsp/liquid-dsp.mk b/package/liquid-dsp/liquid-dsp.mk
index eb4cda67a5..0e7653cb3f 100644
--- a/package/liquid-dsp/liquid-dsp.mk
+++ b/package/liquid-dsp/liquid-dsp.mk
@@ -11,19 +11,39 @@ LIQUID_DSP_LICENSE_FILES = LICENSE
 LIQUID_DSP_INSTALL_STAGING = YES
 LIQUID_DSP_AUTORECONF = YES
 
-LIQUID_DSP_CONF_ENV = \
-	ax_cv_have_mmx_ext=$(if $(BR2_X86_CPU_HAS_MMX),yes,no) \
-	ax_cv_have_sse_ext=$(if $(BR2_X86_CPU_HAS_SSE),yes,no) \
-	ax_cv_have_sse2_ext=$(if $(BR2_X86_CPU_HAS_SSE2),yes,no) \
-	ax_cv_have_sse3_ext=$(if $(BR2_X86_CPU_HAS_SSE3),yes,no) \
-	ax_cv_have_ssse3_ext=$(if $(BR2_X86_CPU_HAS_SSSE3),yes,no) \
-	ax_cv_have_sse41_ext=$(if $(BR2_X86_CPU_HAS_SSE4),yes,no) \
-	ax_cv_have_sse42_ext=$(if $(BR2_X86_CPU_HAS_SSE42),yes,no) \
-	ax_cv_have_avx_ext=$(if $(BR2_X86_CPU_HAS_AVX),yes,no)
-
 LIQUID_DSP_CFLAGS = $(TARGET_CFLAGS)
 LIQUID_DSP_LDFLAGS = $(TARGET_LDFLAGS)
 
+ifeq ($(BR2_X86_CPU_HAS_AVX),y)
+LIQUID_DSP_CONF_ENV += ax_cv_have_avx_ext=yes ax_cv_have_avx_cpu_ext=yes
+else
+LIQUID_DSP_CONF_ENV += ax_cv_have_avx_ext=no ax_cv_have_avx_cpu_ext=no
+endif
+
+ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
+LIQUID_DSP_CONF_ENV += ax_cv_have_avx2_ext=yes ax_cv_have_avx2_cpu_ext=yes
+else
+LIQUID_DSP_CONF_ENV += ax_cv_have_avx2_ext=no ax_cv_have_avx2_cpu_ext=no
+endif
+
+ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
+LIQUID_DSP_CONF_ENV += ax_cv_have_sse2_ext=yes ax_cv_have_sse2_cpu_ext=yes
+else
+LIQUID_DSP_CONF_ENV += ax_cv_have_sse2_ext=no ax_cv_have_sse2_cpu_ext=no
+endif
+
+ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
+LIQUID_DSP_CONF_ENV += ax_cv_have_sse3_ext=yes ax_cv_have_sse3_cpu_ext=yes
+else
+LIQUID_DSP_CONF_ENV += ax_cv_have_sse3_ext=no ax_cv_have_sse3_cpu_ext=no
+endif
+
+ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
+LIQUID_DSP_CONF_ENV += ax_cv_have_sse41_ext=yes ax_cv_have_sse41_cpu_ext=yes
+else
+LIQUID_DSP_CONF_ENV += ax_cv_have_sse41_ext=no ax_cv_have_sse41_cpu_ext=no
+endif
+
 # Speed over accuracy trade off
 ifeq ($(BR2_PACKAGE_LIQUID_DSP_FAST),y)
 LIQUID_DSP_CFLAGS += -ffast-math
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/liquid-dsp: fix x86 builds
  2024-01-08 17:32 [Buildroot] [PATCH 1/1] package/liquid-dsp: fix x86 builds Fabrice Fontaine
@ 2024-01-08 21:05 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2024-01-08 21:05 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Guillaume William Brs, buildroot

Fabrice, All,

On 2024-01-08 18:32 +0100, Fabrice Fontaine spake thusly:
> HAVE_{MMX,SSE2,...} are not defined if ax_cv_have_{i}_cpu_ext is not set
> resulting in the following build failure raised since bump to version
> 1.5.0 in commit c2aaa0fbe2fdf6e599c68169aa7b2e55237190c7 and
> https://github.com/jgaeddert/liquid-dsp/commit/02c4e8b99b11d9f1615b8840f243b08a85b86563:
> 
> src/dotprod/src/dotprod_cccf.sse.c: In function 'dotprod_cccf_execute_sse':
> src/dotprod/src/dotprod_cccf.sse.c:258:5: error: unknown type name '__m128'; did you mean '__int128'?
>   258 |     __m128 v;   // input vector
>       |     ^~~~~~
>       |     __int128
> 
> or
> 
> src/dotprod/src/dotprod_cccf.mmx.c: In function 'dotprod_cccf_execute_mmx':
> src/dotprod/src/dotprod_cccf.mmx.c:262:5: error: unknown type name '__m128'; did you mean '__int128'?
>   262 |     __m128 v;   // input vector
>       |     ^~~~~~
>       |     __int128
> 
> While at it, add AVX2 support and drop options which had no effect
> (MMX, SSE, SSE42 and SSSE3)
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/738ce9d3dc74ec165391f21256c955e5524f1632
>  - http://autobuild.buildroot.org/results/a2d150c724ab6787aeabaf31f65116f802e8584e
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/liquid-dsp/liquid-dsp.mk | 40 ++++++++++++++++++++++++--------
>  1 file changed, 30 insertions(+), 10 deletions(-)
> 
> diff --git a/package/liquid-dsp/liquid-dsp.mk b/package/liquid-dsp/liquid-dsp.mk
> index eb4cda67a5..0e7653cb3f 100644
> --- a/package/liquid-dsp/liquid-dsp.mk
> +++ b/package/liquid-dsp/liquid-dsp.mk
> @@ -11,19 +11,39 @@ LIQUID_DSP_LICENSE_FILES = LICENSE
>  LIQUID_DSP_INSTALL_STAGING = YES
>  LIQUID_DSP_AUTORECONF = YES
>  
> -LIQUID_DSP_CONF_ENV = \
> -	ax_cv_have_mmx_ext=$(if $(BR2_X86_CPU_HAS_MMX),yes,no) \
> -	ax_cv_have_sse_ext=$(if $(BR2_X86_CPU_HAS_SSE),yes,no) \
> -	ax_cv_have_sse2_ext=$(if $(BR2_X86_CPU_HAS_SSE2),yes,no) \
> -	ax_cv_have_sse3_ext=$(if $(BR2_X86_CPU_HAS_SSE3),yes,no) \
> -	ax_cv_have_ssse3_ext=$(if $(BR2_X86_CPU_HAS_SSSE3),yes,no) \
> -	ax_cv_have_sse41_ext=$(if $(BR2_X86_CPU_HAS_SSE4),yes,no) \
> -	ax_cv_have_sse42_ext=$(if $(BR2_X86_CPU_HAS_SSE42),yes,no) \
> -	ax_cv_have_avx_ext=$(if $(BR2_X86_CPU_HAS_AVX),yes,no)

Why don't you just update this list in the same format? We do have that
kind of formatting elsewhere (eg. opencv3 and opencv4) and it is less
verbose than the alternative...

Regards,
Yann E. MORIN.

>  LIQUID_DSP_CFLAGS = $(TARGET_CFLAGS)
>  LIQUID_DSP_LDFLAGS = $(TARGET_LDFLAGS)
>  
> +ifeq ($(BR2_X86_CPU_HAS_AVX),y)
> +LIQUID_DSP_CONF_ENV += ax_cv_have_avx_ext=yes ax_cv_have_avx_cpu_ext=yes
> +else
> +LIQUID_DSP_CONF_ENV += ax_cv_have_avx_ext=no ax_cv_have_avx_cpu_ext=no
> +endif
> +
> +ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
> +LIQUID_DSP_CONF_ENV += ax_cv_have_avx2_ext=yes ax_cv_have_avx2_cpu_ext=yes
> +else
> +LIQUID_DSP_CONF_ENV += ax_cv_have_avx2_ext=no ax_cv_have_avx2_cpu_ext=no
> +endif
> +
> +ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
> +LIQUID_DSP_CONF_ENV += ax_cv_have_sse2_ext=yes ax_cv_have_sse2_cpu_ext=yes
> +else
> +LIQUID_DSP_CONF_ENV += ax_cv_have_sse2_ext=no ax_cv_have_sse2_cpu_ext=no
> +endif
> +
> +ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
> +LIQUID_DSP_CONF_ENV += ax_cv_have_sse3_ext=yes ax_cv_have_sse3_cpu_ext=yes
> +else
> +LIQUID_DSP_CONF_ENV += ax_cv_have_sse3_ext=no ax_cv_have_sse3_cpu_ext=no
> +endif
> +
> +ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
> +LIQUID_DSP_CONF_ENV += ax_cv_have_sse41_ext=yes ax_cv_have_sse41_cpu_ext=yes
> +else
> +LIQUID_DSP_CONF_ENV += ax_cv_have_sse41_ext=no ax_cv_have_sse41_cpu_ext=no
> +endif
> +
>  # Speed over accuracy trade off
>  ifeq ($(BR2_PACKAGE_LIQUID_DSP_FAST),y)
>  LIQUID_DSP_CFLAGS += -ffast-math
> -- 
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-08 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-08 17:32 [Buildroot] [PATCH 1/1] package/liquid-dsp: fix x86 builds Fabrice Fontaine
2024-01-08 21:05 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.