[v2] go: disable mvsx and maltivec for aix/ppc

Message ID AM6PR02MB4950A94ED9942CF12E91F6B8EA230@AM6PR02MB4950.eurprd02.prod.outlook.com
State New
Headers show
Series
  • [v2] go: disable mvsx and maltivec for aix/ppc
Related show

Commit Message

CHIGOT, CLEMENT April 23, 2019, 8:27 a.m.
Description: 
  * This patch removes -mvsx and -maltivec for go aix/ppc. 
     These options don't seem compatible with Go stack layout. 

Tests: 
  * AIX 7.2:  Configure/Build: SUCCESS

Changelog:
  * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Remove OPTION_MASK_VSX 
     and OPTION_MASK_ALTIVEC from rs6000_isa_flags with Go on 32 bits. 
  * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.



Clément Chigot
ATOS Bull SAS
1 rue de Provence - 38432 Échirolles - France

Comments

Ian Lance Taylor April 24, 2019, 1:31 p.m. | #1
On Tue, Apr 23, 2019 at 1:27 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>

> Description:

>   * This patch removes -mvsx and -maltivec for go aix/ppc.

>      These options don't seem compatible with Go stack layout.

>

> Tests:

>   * AIX 7.2:  Configure/Build: SUCCESS

>

> Changelog:

>   * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Remove OPTION_MASK_VSX

>      and OPTION_MASK_ALTIVEC from rs6000_isa_flags with Go on 32 bits.

>   * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.


I still don't understand why there is a problem here.  When using
gccgo the "Go stack layout" is exactly the same as the C stack layout.
But this patch is fine with me if it's OK with the AIX maintainers.

Ian
David Edelsohn April 24, 2019, 1:34 p.m. | #2
On Wed, Apr 24, 2019 at 9:31 AM Ian Lance Taylor <iant@golang.org> wrote:
>

> On Tue, Apr 23, 2019 at 1:27 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:

> >

> > Description:

> >   * This patch removes -mvsx and -maltivec for go aix/ppc.

> >      These options don't seem compatible with Go stack layout.

> >

> > Tests:

> >   * AIX 7.2:  Configure/Build: SUCCESS

> >

> > Changelog:

> >   * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Remove OPTION_MASK_VSX

> >      and OPTION_MASK_ALTIVEC from rs6000_isa_flags with Go on 32 bits.

> >   * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.

>

> I still don't understand why there is a problem here.  When using

> gccgo the "Go stack layout" is exactly the same as the C stack layout.

> But this patch is fine with me if it's OK with the AIX maintainers.


There is an underlying problem that Clement has not yet found.  This
is a workaround.

I will test the patch in my build.

Thanks, David
David Edelsohn April 24, 2019, 6:05 p.m. | #3
On Tue, Apr 23, 2019 at 4:27 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>

> Description:

>   * This patch removes -mvsx and -maltivec for go aix/ppc.

>      These options don't seem compatible with Go stack layout.

>

> Tests:

>   * AIX 7.2:  Configure/Build: SUCCESS

>

> Changelog:

>   * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Remove OPTION_MASK_VSX

>      and OPTION_MASK_ALTIVEC from rs6000_isa_flags with Go on 32 bits.

>   * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Likewise.


I have committed this patch.

Thanks, David
CHIGOT, CLEMENT April 25, 2019, 6:49 a.m. | #4
From: David Edelsohn <dje.gcc@gmail.com>

> I have committed this patch.

> 

> Thanks, David


Thanks, I'll warn you if I ever understand what's wrong with it. 

Clément

Patch

Index: config/rs6000/aix71.h
===================================================================
--- config/rs6000/aix71.h	(revision 270457)
+++ config/rs6000/aix71.h	(working copy)
@@ -56,6 +56,12 @@  do {									\
     {									\
       rs6000_current_cmodel = CMODEL_LARGE;				\
     }									\
+  if (! strcmp (lang_hooks.name, "GNU Go")				\
+      && TARGET_32BIT)							\
+    {									\
+      /* aix/ppc doesn't support -mvsx and -maltivec with Go */	\
+      rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);	\
+    }									\
 } while (0)
 
 #undef ASM_SPEC
Index: config/rs6000/aix72.h
===================================================================
--- config/rs6000/aix72.h	(revision 270457)
+++ config/rs6000/aix72.h	(working copy)
@@ -56,6 +56,12 @@  do {									\
     {									\
       rs6000_current_cmodel = CMODEL_LARGE;				\
     }									\
+  if (! strcmp (lang_hooks.name, "GNU Go")				\
+      && TARGET_32BIT)							\
+    {									\
+      /* aix/ppc doesn't support -mvsx and -maltivec with Go */	\
+      rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);	\
+    }									\
 } while (0)
 
 #undef ASM_SPEC