17/06/2020 12:40, Bruce Richardson:
> Rather than checking the binutils version number, which can lead to
> unnecessary disabling of AVX512 if fixes have been backported to distro
> versions, we can instead check the output of "as" from binutils to see if
> it is correct.
> 
> These checks use the minimal assembly reproduction code posted to the
> public bug tracker for gcc/binutils for those issues [1][2]. If the
> binutils bug is present, the instruction parameters - specifically the
> displacement parameter - will be different in the disassembled output
> compared to the input. Therefore each check involves assembling a single
> instruction and disassembling it again, checking that the two match.

Whaoh, that's a very specific optimization :)
Which distro is affected (backported binutils fix)?

> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028
> [2] https://sourceware.org/bugzilla/show_bug.cgi?id=23465
> 
> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
> ---
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> -subdir('pmdinfogen')

Why removing pmdinfogen?

> --- a/meson.build
> +++ b/meson.build
> +# do configuration and get tool paths
> +subdir('buildtools')
>  subdir('config')
>  
>  # build libs and drivers
> -subdir('buildtools')
> +subdir('buildtools/pmdinfogen')

Is it related to binutils check?

[...]
> -     ldver = run_command('ld', '-v').stdout().strip()
> -     if ldver.contains('2.30') and cc.has_argument('-mno-avx512f')
> +     as_ok = run_command(binutils_avx512_check)
> +     if as_ok.returncode() != 0 and cc.has_argument('-mno-avx512f')

"as_ok" is difficult to understand.
I would suggest "binutils_avx512_ok".

> +             message('Binutils error with AVX512 assembly, disabling AVX512 
> support')

It looks like something which should be part of meson itself.


Reply via email to