Commit 2d63a517e4084ec80403cd9f278690fa8b676cc4

Message ID CAMe9rOryTptyXVUoYME_WV7H_tTTh-33Eb=4KgeMcM3-vzipKA@mail.gmail.com
State Committed
Headers

Commit Message

H.J. Lu March 14, 2014, 3:30 p.m. UTC
  On Thu, Mar 13, 2014 at 7:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Mar 13, 2014 at 6:57 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
>> After latest commit:
>>
>> commit 2d63a517e4084ec80403cd9f278690fa8b676cc4
>> Author: Igor Zamyatin <igor.zamyatin@intel.com>
>> Date:   Thu Mar 13 11:10:22 2014 -0700
>>
>>     Save and restore AVX-512 zmm registers to x86-64 ld.so
>> ...
>>
>> "make check" fails like this for me:
>>
>>
>> /tmp/ccJEXrrY.s: Assembler messages:
>> /tmp/ccJEXrrY.s:47: Error: no such instruction: `vmovdqa64 %zmm0,-176(%rbp)'
>> /tmp/ccJEXrrY.s:51: Error: bad register name `%zmm0'
>> /tmp/ccJEXrrY.s:57: Error: no such instruction: `vmovdqa64 %zmm1,-240(%rbp)'
>> /tmp/ccJEXrrY.s:58: Error: no such instruction: `vmovdqa64 %zmm2,-304(%rbp)'
>> /tmp/ccJEXrrY.s:59: Error: no such instruction: `vmovdqa64 %zmm3,-368(%rbp)'
>> /tmp/ccJEXrrY.s:60: Error: no such instruction: `vmovdqa64 %zmm4,-432(%rbp)'
>> /tmp/ccJEXrrY.s:61: Error: no such instruction: `vmovdqa64 %zmm5,-496(%rbp)'
>> /tmp/ccJEXrrY.s:62: Error: no such instruction: `vmovdqa64 %zmm6,-560(%rbp)'
>> /tmp/ccJEXrrY.s:63: Error: no such instruction: `vmovdqa64 %zmm7,-624(%rbp)'
>> /tmp/ccJEXrrY.s:65: Error: no such instruction: `vmovdqa64 %zmm0,-112(%rbp)'
>> /tmp/ccJEXrrY.s:84: Error: bad register name `%zmm0'
>> /tmp/ccJEXrrY.s:90: Error: no such instruction: `vmovdqa64 %zmm0,-112(%rbp)'
>> ...
>> make[2]: *** [/build/elf/tst-auditmod10a.os] Error 1
>>
>>
>> Likely my binutils/as are too old. Should this test be conditional?
>
> You have GCC 4.9 and a very old binutils.  We didn't test this combination.

I am testing this patch.  It checks AVX-512 assembler support first and
sets libc_cv_cc_avx512 to $libc_cv_asm_avx512, instead of yes.  GCC
won't support AVX-512 if assembler doesn't support it.  I will check it
in if all tests pass.  Sorry for the inconvenience.

Thanks.
  

Comments

H.J. Lu March 14, 2014, 3:53 p.m. UTC | #1
On Fri, Mar 14, 2014 at 8:30 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Mar 13, 2014 at 7:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Mar 13, 2014 at 6:57 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
>>> After latest commit:
>>>
>>> commit 2d63a517e4084ec80403cd9f278690fa8b676cc4
>>> Author: Igor Zamyatin <igor.zamyatin@intel.com>
>>> Date:   Thu Mar 13 11:10:22 2014 -0700
>>>
>>>     Save and restore AVX-512 zmm registers to x86-64 ld.so
>>> ...
>>>
>>> "make check" fails like this for me:
>>>
>>>
>>> /tmp/ccJEXrrY.s: Assembler messages:
>>> /tmp/ccJEXrrY.s:47: Error: no such instruction: `vmovdqa64 %zmm0,-176(%rbp)'
>>> /tmp/ccJEXrrY.s:51: Error: bad register name `%zmm0'
>>> /tmp/ccJEXrrY.s:57: Error: no such instruction: `vmovdqa64 %zmm1,-240(%rbp)'
>>> /tmp/ccJEXrrY.s:58: Error: no such instruction: `vmovdqa64 %zmm2,-304(%rbp)'
>>> /tmp/ccJEXrrY.s:59: Error: no such instruction: `vmovdqa64 %zmm3,-368(%rbp)'
>>> /tmp/ccJEXrrY.s:60: Error: no such instruction: `vmovdqa64 %zmm4,-432(%rbp)'
>>> /tmp/ccJEXrrY.s:61: Error: no such instruction: `vmovdqa64 %zmm5,-496(%rbp)'
>>> /tmp/ccJEXrrY.s:62: Error: no such instruction: `vmovdqa64 %zmm6,-560(%rbp)'
>>> /tmp/ccJEXrrY.s:63: Error: no such instruction: `vmovdqa64 %zmm7,-624(%rbp)'
>>> /tmp/ccJEXrrY.s:65: Error: no such instruction: `vmovdqa64 %zmm0,-112(%rbp)'
>>> /tmp/ccJEXrrY.s:84: Error: bad register name `%zmm0'
>>> /tmp/ccJEXrrY.s:90: Error: no such instruction: `vmovdqa64 %zmm0,-112(%rbp)'
>>> ...
>>> make[2]: *** [/build/elf/tst-auditmod10a.os] Error 1
>>>
>>>
>>> Likely my binutils/as are too old. Should this test be conditional?
>>
>> You have GCC 4.9 and a very old binutils.  We didn't test this combination.
>
> I am testing this patch.  It checks AVX-512 assembler support first and
> sets libc_cv_cc_avx512 to $libc_cv_asm_avx512, instead of yes.  GCC
> won't support AVX-512 if assembler doesn't support it.  I will check it
> in if all tests pass.  Sorry for the inconvenience.
>

I checked it in:

commit aa4de9cea5c07d43caeaca9722c2d417e9a2919c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 14 08:51:25 2014 -0700

    Check AVX-512 assembler support first

    It checks AVX-512 assembler support first and sets libc_cv_cc_avx512 to
    $libc_cv_asm_avx512, instead of yes.  GCC won't support AVX-512 if
    assembler doesn't support it.

      * sysdeps/x86_64/configure.ac: Check AVX-512 assembler support
      first.  Disable AVX-512 GCC support if assembler doesn't support
      it.
      * sysdeps/x86_64/configure: Regenerated.
  
Paul Pluzhnikov March 14, 2014, 4:08 p.m. UTC | #2
On Fri, Mar 14, 2014 at 8:53 AM, H.J. Lu <hjl.tools@gmail.com> wrote:

> I checked it in:

I was just about to comment.

The patch doesn't appear to fix the problem: while it does set
libc_cv_asm_avx512=no, I still get an error at "make check".

AFAICT, tst-auditmod10 is not conditional on asm_avx512.

/tmp/ccha40tw.s: Assembler messages:
/tmp/ccha40tw.s:47: Error: no such instruction: `vmovdqa64 %zmm0,-176(%rbp)'
/tmp/ccha40tw.s:51: Error: bad register name `%zmm0'
...
make[2]: *** [/build/elf/tst-auditmod10a.os] Error 1

Here is what AVX in my config.log looks like:

libc_cv_asm_avx512=no
libc_cv_cc_avx512=yes
libc_cv_cc_avx=yes
libc_cv_cc_sse2avx=yes


Please note: I am not complaining and could easily update my assembler,
if that's the right thing to do here.

For the record:

gcc --version
gcc (GCC) 4.9.0 20140309 (experimental)
...

gcc -Wa,--version -xc /dev/null
GNU assembler (GNU Binutils) 2.22.52.20120719
...


Thanks,
  
H.J. Lu March 14, 2014, 4:34 p.m. UTC | #3
On Fri, Mar 14, 2014 at 9:08 AM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> On Fri, Mar 14, 2014 at 8:53 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
>> I checked it in:
>
> I was just about to comment.
>
> The patch doesn't appear to fix the problem: while it does set
> libc_cv_asm_avx512=no, I still get an error at "make check".
>
> AFAICT, tst-auditmod10 is not conditional on asm_avx512.
>
> /tmp/ccha40tw.s: Assembler messages:
> /tmp/ccha40tw.s:47: Error: no such instruction: `vmovdqa64 %zmm0,-176(%rbp)'
> /tmp/ccha40tw.s:51: Error: bad register name `%zmm0'
> ...
> make[2]: *** [/build/elf/tst-auditmod10a.os] Error 1
>
> Here is what AVX in my config.log looks like:
>
> libc_cv_asm_avx512=no
> libc_cv_cc_avx512=yes
> libc_cv_cc_avx=yes
> libc_cv_cc_sse2avx=yes
>
>

Did you remove the old glibc build directory first? Please show
me the output of:

# grep -i AVX512 config.h config.make

I got

config.h:/* Define if compiler supports AVX512.  */
config.h:/* #undef HAVE_AVX512_SUPPORT */
config.h:/* Define if assembler supports AVX512.  */
config.h:/* #undef HAVE_AVX512_ASM_SUPPORT */
config.make:config-cflags-avx512 = no

with GCC 4.9 and binutils  2.23.51.
  
Paul Pluzhnikov March 14, 2014, 5:25 p.m. UTC | #4
On Fri, Mar 14, 2014 at 9:34 AM, H.J. Lu <hjl.tools@gmail.com> wrote:

> Did you remove the old glibc build directory first?

No, I did not. After doing that, the new failures are indeed gone.

Thanks for the fix!

> Please show
> me the output of:
>
> # grep -i AVX512 config.h config.make
>
> I got
>
> config.h:/* Define if compiler supports AVX512.  */
> config.h:/* #undef HAVE_AVX512_SUPPORT */
> config.h:/* Define if assembler supports AVX512.  */
> config.h:/* #undef HAVE_AVX512_ASM_SUPPORT */
> config.make:config-cflags-avx512 = no

I've got the same output.
  

Patch

diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
index 5e5d61b..d34f9a8 100644
--- a/sysdeps/x86_64/configure.ac
+++ b/sysdeps/x86_64/configure.ac
@@ -23,15 +23,6 @@  if test $libc_cv_cc_avx = yes; then
 fi
 LIBC_CONFIG_VAR([config-cflags-avx], [$libc_cv_cc_avx])

-dnl Check if -mavx512f works.
-AC_CACHE_CHECK(for AVX512 support, libc_cv_cc_avx512, [dnl
-LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=yes],
[libc_cv_cc_avx512=no])
-])
-if test $libc_cv_cc_avx512 = yes; then
-  AC_DEFINE(HAVE_AVX512_SUPPORT)
-fi
-LIBC_CONFIG_VAR([config-cflags-avx512], [$libc_cv_cc_avx512])
-
 dnl Check if asm supports AVX512.
 AC_CACHE_CHECK(for AVX512 support in assembler, libc_cv_asm_avx512, [dnl