https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87171

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-09-01
     Ever confirmed|0                           |1

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #3)
> So, your CPU doesn't support AVX, which is why xsave* is turned off:
> 
> #define XCR_AVX_ENABLED_MASK \
>    (XSTATE_SSE | XSTATE_YMM)
> 
>    if (has_osxsave)
>      asm (".byte 0x0f; .byte 0x01; .byte 0xd0"
>         : "=a" (eax), "=d" (edx)
>         : "c" (XCR_XFEATURE_ENABLED_MASK));
>    else
>      eax = 0;
> 
>   /* Check if AVX registers are supported.  */
>   if ((eax & XCR_AVX_ENABLED_MASK) != XCR_AVX_ENABLED_MASK)
>     {
>       has_avx = 0;
>       has_avx2 = 0;
>       has_fma = 0;
>       has_fma4 = 0;
>       has_f16c = 0;
>       has_xop = 0;
>       has_xsave = 0;
>       has_xsaveopt = 0;
>       has_xsaves = 0;
>       has_xsavec = 0;
>     }
> 
> Is XSAVE* useful for anything when AVX isn't enabled?

XSAVE* are needed for other states.  It is wrong to disable XSAVE*
when AVX isn't supported.

Reply via email to