[PATCH v2 15/28] x86: Use -mavx instead of -msse2avx
H.J. Lu
hjl.tools@gmail.com
Tue Oct 28 19:57:53 GMT 2025
On Wed, Oct 29, 2025 at 3:54 AM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 28/10/25 16:02, H.J. Lu wrote:
> > On Wed, Oct 29, 2025 at 1:13 AM Adhemerval Zanella
> > <adhemerval.zanella@linaro.org> wrote:
> >>
> >> clang supports it from version 19 and onwards, but it should be gated
> >> as an option to assembler (either with -Wa or -Xassembler). Add a
> >> test for -Wa as well if -msse2avx fully supported by the compiler.
> >> ---
> >> sysdeps/x86_64/fpu/multiarch/Makefile | 14 +++++++-------
> >> 1 file changed, 7 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
> >> index 708b14297f..bd887cd59c 100644
> >> --- a/sysdeps/x86_64/fpu/multiarch/Makefile
> >> +++ b/sysdeps/x86_64/fpu/multiarch/Makefile
> >> @@ -150,13 +150,13 @@ CFLAGS-s_sin-fma4.c = -mfma4
> >> CFLAGS-s_tan-fma4.c = -mfma4
> >> CFLAGS-s_sincos-fma4.c = -mfma4
> >>
> >> -CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX
> >> -CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX
> >> -CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX
> >> -CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
> >> -CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
> >> -CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
> >> -CFLAGS-s_sincos-avx.c = -msse2avx -DSSE2AVX
> >> +CFLAGS-e_atan2-avx.c = -mavx -DSSE2AVX
> >> +CFLAGS-e_exp-avx.c = -mavx -DSSE2AVX
> >> +CFLAGS-e_log-avx.c = -mavx -DSSE2AVX
> >> +CFLAGS-s_atan-avx.c = -mavx -DSSE2AVX
> >> +CFLAGS-s_sin-avx.c = -mavx -DSSE2AVX
> >> +CFLAGS-s_tan-avx.c = -mavx -DSSE2AVX
> >> +CFLAGS-s_sincos-avx.c = -mavx -DSSE2AVX
> >
> > -DSSE2AVX shouldn't be necessary.
>
> I ended up re-using this on clang optimization for AVX [1].
>
> [1] https://patchwork.sourceware.org/project/glibc/patch/20251028171141.3208834-19-adhemerval.zanella@linaro.org/
>
"|| defined SSE2AVX" can be removed.
--
H.J.
More information about the Libc-alpha
mailing list