Message ID | 1470272940-22128-1-git-send-email-aurelien@aurel32.net |
---|---|
State | New |
Headers | show |
From: Aurelien Jarno <aurelien@aurel32.net> Date: Thu, 4 Aug 2016 03:08:58 +0200 > When building for sparc32/sparcv9 or sparc64, we assume that VIS > instructions are available and use them in the sparc specific assembly > code. However we do not tell GCC to use such instructions, resulting in > slightly suboptimal code. > > Fix that by passing -Wa,-Av9a -mvis to GCC. > > Changelog: > * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Add -mvis. > * sysdeps/sparc/sparc64/Makefile (sysdep-CFLAGS): New. Define to > -Wa,-Av9a -mvis. All three patches look great, please commit them and thanks for doing this work.
On 04 Aug 2016 03:08, Aurelien Jarno wrote: > When building for sparc32/sparcv9 or sparc64, we assume that VIS > instructions are available and use them in the sparc specific assembly > code. However we do not tell GCC to use such instructions, resulting in > slightly suboptimal code. > > Fix that by passing -Wa,-Av9a -mvis to GCC. does this address: https://sourceware.org/bugzilla/show_bug.cgi?id=19477 it also seems to imply that v9 is *not* supported, and if you want to build for sparc64, you must have at least v9a ? and that VIS is always supported ? glancing at some wiki history, it doesn't seem like a big problem, but it is different from before. -mike
On 2016-08-04 07:29, Mike Frysinger wrote: > On 04 Aug 2016 03:08, Aurelien Jarno wrote: > > When building for sparc32/sparcv9 or sparc64, we assume that VIS > > instructions are available and use them in the sparc specific assembly > > code. However we do not tell GCC to use such instructions, resulting in > > slightly suboptimal code. > > > > Fix that by passing -Wa,-Av9a -mvis to GCC. > > does this address: > https://sourceware.org/bugzilla/show_bug.cgi?id=19477 Depends what you mean by address. The issue will disappear for sure. However the real issue seems to be a misconfiguration between binutils and GCC. The GCC call doesn't force any specific architecture, so it means GCC is configure to default to v9a, while binutils is configured for v9. > it also seems to imply that v9 is *not* supported, and if you want to > build for sparc64, you must have at least v9a ? and that VIS is always > supported ? glancing at some wiki history, it doesn't seem like a big > problem, but it is different from before. Yes we have v9a code for example in sparc/sparc64/memset.S for more than 17 years, so it means v9 is not support since at least that time. Now I do wonder if pure v9 CPUs (ie v9 without VIS) have ever existed. Aurelien
On 2016-08-03 22:19, David Miller wrote: > From: Aurelien Jarno <aurelien@aurel32.net> > Date: Thu, 4 Aug 2016 03:08:58 +0200 > > > When building for sparc32/sparcv9 or sparc64, we assume that VIS > > instructions are available and use them in the sparc specific assembly > > code. However we do not tell GCC to use such instructions, resulting in > > slightly suboptimal code. > > > > Fix that by passing -Wa,-Av9a -mvis to GCC. > > > > Changelog: > > * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Add -mvis. > > * sysdeps/sparc/sparc64/Makefile (sysdep-CFLAGS): New. Define to > > -Wa,-Av9a -mvis. > > All three patches look great, please commit them and thanks for doing > this work. Thanks for the review, I have just pushed the patches.
diff --git a/ChangeLog b/ChangeLog index ac692dc..c3fe9fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-08-04 Aurelien Jarno <aurelien@aurel32.net> + + * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Add -mvis. + * sysdeps/sparc/sparc64/Makefile (sysdep-CFLAGS): New. Define to + -Wa,-Av9a -mvis. + 2016-08-03 Joseph Myers <joseph@codesourcery.com> * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): New diff --git a/sysdeps/sparc/sparc32/sparcv9/Makefile b/sysdeps/sparc/sparc32/sparcv9/Makefile index fefc742..08c5a96 100644 --- a/sysdeps/sparc/sparc32/sparcv9/Makefile +++ b/sysdeps/sparc/sparc32/sparcv9/Makefile @@ -1,4 +1,4 @@ -sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a +sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a -mvis ifeq ($(have-as-vis3),yes) ASFLAGS-.o += -Wa,-Av9d diff --git a/sysdeps/sparc/sparc64/Makefile b/sysdeps/sparc/sparc64/Makefile index 3a12510..fbabf69 100644 --- a/sysdeps/sparc/sparc64/Makefile +++ b/sysdeps/sparc/sparc64/Makefile @@ -1,3 +1,5 @@ +sysdep-CFLAGS += -Wa,-Av9a -mvis + ifeq ($(subdir),string) sysdep_routines += align-cpy endif