This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [i386, libgcc] PR 82196 -mcall-ms2sysv-xlogues emits wrong AVX/SSE MOV


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]