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.

Thanks,
Daniel

Reply via email to