This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [i386, libgcc] PR 82196 -mcall-ms2sysv-xlogues emits wrong AVX/SSE MOV
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Daniel Santos <daniel dot santos at pobox dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Ian Lance Taylor <ian at airs dot com>, Dominique d'Humières <dominiq at lps dot ens dot fr>, Iain Sandoe <iain at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 21 Sep 2017 08:19:57 +0200
- Subject: Re: [PATCH] [i386, libgcc] PR 82196 -mcall-ms2sysv-xlogues emits wrong AVX/SSE MOV
- Authentication-results: sourceware.org; auth=none
- References: <FBAB0C90-D00F-4848-8195-5ADA1ECC10CF@lps.ens.fr> <4707edef-68de-9165-7991-99077ea8aeee@pobox.com> <20170919065824.GJ1701@tucnak> <86c30824-d5a2-9f01-e1c4-76f8b1bf8a26@pobox.com>
On Thu, Sep 21, 2017 at 3:58 AM, Daniel Santos <daniel.santos@pobox.com> wrote:
> On 09/19/2017 01:58 AM, Jakub Jelinek wrote:
>> What can be done in libgcc is detect in configure whether the assembler
>> supports AVX, and if not, provide some alternative (e.g. because the insns
>> are always the same, you could just code them as .byte or something similar).
>>
>> Say like:
>> --- i386-asm.h 2017-09-18 18:34:30.917126996 +0200
>> +++ i386-asm.h 2017-09-19 08:56:58.829559038 +0200
>> @@ -70,6 +70,7 @@ ASMNAME(fn):
>> #ifdef MS2SYSV_STUB_AVX
>> # define MS2SYSV_STUB_PREFIX __avx_
>> # define MOVAPS vmovaps
>> +# define BYTE .byte
>> #elif defined(MS2SYSV_STUB_SSE)
>> # define MS2SYSV_STUB_PREFIX __sse_
>> # define MOVAPS movaps
>> @@ -84,7 +85,8 @@ ASMNAME(fn):
>> FUNC_END(PASTE2(MS2SYSV_STUB_PREFIX, base_name))
>>
>> /* Save SSE registers 6-15. off is the offset of rax to get to xmm6. */
>> -# define SSE_SAVE \
>> +# ifdef HAVE_AS_AVX
>
> I'm not exactly an autotools expert, but libtim defines HAVE_AS_AVX from
> libitm/acinclude.m4 -- of course I need it in libgcc. Similarly, gcc
> has a nice generic gcc_GAS_CHECK_FEATURE macro in gcc/acinclude.m4 which
> it uses for all of its HAVE_AS_* macro tests defined in
> gcc/configure.ac. I can just copy, paste and edit what's in libitm, but
> I find that rather distasteful. Is there a cleaner way to do this? Can
> I suck gcc_GAS_CHECK_FEATURE and it's deps out of gcc/acinclude.m4 and
> put it somewhere central, like config/as.m4? The upside would be the
> ability to make HAVE_AS_* macros in other sub-projects more uniform.
>
> Alternatively, I can just do the copy and paste and deal with it -- it's
> not that much code. :)
>
> Also, is there any sense in doing this same check for SSE support in the
> assembler? It's been out for 18 years now.
binutils 2.13.1 are required to buld the compiler on i?86-*-linux*, so
I guess SSE support is assumed.
Uros.