All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/binutils: prevent selecting 2.37 for AVX512 systems
@ 2022-10-26 17:54 Thomas Petazzoni via buildroot
  2022-10-30 19:33 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-26 17:54 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Giulio Benetti, Yann E. MORIN, Thomas Petazzoni

Support for the AVX512FP16 instructions was added in binutils
2.38. See the binutils 2.38 releases notes [0] that state:

    X86:
    [...]
      * Add support for Intel AVX512_FP16 instructions.

[0] https://sourceware.org/pipermail/binutils/2022-February/119721.html

It turns out that when building GCC 12.x, some of these AVX512FP16
instructions are now used, and therefore when binutils < 2.38 is used,
the build fails as the assembler does not recognize those
instructions:

/tmp/ccChzL2g.s: Assembler messages:
/tmp/ccChzL2g.s:20: Error: no such instruction: `vmovw 24(%esp),%xmm2'
/tmp/ccChzL2g.s:21: Error: no such instruction: `vmovw 28(%esp),%xmm3'
/tmp/ccChzL2g.s:22: Error: no such instruction: `vmovw 32(%esp),%xmm4'
/tmp/ccChzL2g.s:23: Error: no such instruction: `vmovw 36(%esp),%xmm5'
/tmp/ccChzL2g.s:30: Error: no such instruction: `vcvtsh2ss %xmm2,%xmm6,%xmm6'
/tmp/ccChzL2g.s:36: Error: no such instruction: `vcvtsh2ss %xmm3,%xmm6,%xmm6'
/tmp/ccChzL2g.s:42: Error: no such instruction: `vcvtsh2ss %xmm4,%xmm7,%xmm7'
/tmp/ccChzL2g.s:48: Error: no such instruction: `vcvtsh2ss %xmm5,%xmm1,%xmm1'
/tmp/ccChzL2g.s:80: Error: no such instruction: `vcvtss2sh (%esp),%xmm1,%xmm1'
/tmp/ccChzL2g.s:96: Error: no such instruction: `vcvtss2sh (%esp),%xmm0,%xmm0'
/tmp/ccChzL2g.s:100: Error: no such instruction: `vucomish %xmm1,%xmm1'
/tmp/ccChzL2g.s:103: Error: no such instruction: `vucomish %xmm0,%xmm0'
/tmp/ccChzL2g.s:122: Error: no such instruction: `vucomish %xmm2,%xmm2'

The same issue does not occur with GCC 11.x, but nothing prevents
other packages than GCC to use those instructions, so the problem
really lies on the binutils side missing the support for those
instructions.

Also, in Buildroot, we do not distinguish AVX512 in general from
AVX512FP16 specifically, so our only option is to make binutils 2.37
unavailable for AVX512 systems even if some of them perhaps don't
support AVX512FP16 anyway. This seems like a reasonable trade-off, as
binutils 2.38 is anyway already the default in Buildroot, and
AVX512-capable systems are fairly recent, and therefore using a recent
binutils version should not be a problem on these platforms.

Fixes:

  http://autobuild.buildroot.net/results/eb6e28c934654e6d714973415a2fb452f9580279/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/binutils/Config.in.host | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host
index 51802db043..5dd2af2f9c 100644
--- a/package/binutils/Config.in.host
+++ b/package/binutils/Config.in.host
@@ -14,6 +14,9 @@ choice
 
 config BR2_BINUTILS_VERSION_2_37_X
 	bool "binutils 2.37"
+	# AVX512FP16 instructions were not supported before binutils
+	# 2.38
+	depends on !BR2_X86_CPU_HAS_AVX512
 
 config BR2_BINUTILS_VERSION_2_38_X
 	bool "binutils 2.38"
-- 
2.37.3

_______________________________________________
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] package/binutils: prevent selecting 2.37 for AVX512 systems
  2022-10-26 17:54 [Buildroot] [PATCH] package/binutils: prevent selecting 2.37 for AVX512 systems Thomas Petazzoni via buildroot
@ 2022-10-30 19:33 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2022-10-30 19:33 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Romain Naour, Giulio Benetti, buildroot

Thomas, All,

On 2022-10-26 19:54 +0200, Thomas Petazzoni via buildroot spake thusly:
> Support for the AVX512FP16 instructions was added in binutils
> 2.38. See the binutils 2.38 releases notes [0] that state:
>     X86:
>     [...]
>       * Add support for Intel AVX512_FP16 instructions.
[--SNIP--]
> Also, in Buildroot, we do not distinguish AVX512 in general from
> AVX512FP16 specifically, so our only option is to make binutils 2.37
> unavailable for AVX512 systems even if some of them perhaps don't
> support AVX512FP16 anyway. This seems like a reasonable trade-off, as
> binutils 2.38 is anyway already the default in Buildroot, and
> AVX512-capable systems are fairly recent, and therefore using a recent
> binutils version should not be a problem on these platforms.

ACK

> Fixes:
> 
>   http://autobuild.buildroot.net/results/eb6e28c934654e6d714973415a2fb452f9580279/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/binutils/Config.in.host | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host
> index 51802db043..5dd2af2f9c 100644
> --- a/package/binutils/Config.in.host
> +++ b/package/binutils/Config.in.host
> @@ -14,6 +14,9 @@ choice
>  
>  config BR2_BINUTILS_VERSION_2_37_X
>  	bool "binutils 2.37"
> +	# AVX512FP16 instructions were not supported before binutils
> +	# 2.38
> +	depends on !BR2_X86_CPU_HAS_AVX512
>  
>  config BR2_BINUTILS_VERSION_2_38_X
>  	bool "binutils 2.38"
> -- 
> 2.37.3
> 
> _______________________________________________
> 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:[~2022-10-30 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 17:54 [Buildroot] [PATCH] package/binutils: prevent selecting 2.37 for AVX512 systems Thomas Petazzoni via buildroot
2022-10-30 19:33 ` 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.