Patchwork [rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled.

login
register
mail settings
Submitter Peter Bergner
Date July 2, 2010, 4:44 p.m.
Message ID <1278089075.3681.64.camel@otta>
Download mbox | patch
Permalink /patch/57676/
State New
Headers show

Comments

Peter Bergner - July 2, 2010, 4:44 p.m.
On Thu, 2010-07-01 at 22:48 -0500, Peter Bergner wrote:
> On Fri, 2010-07-02 at 12:55 +0930, Alan Modra wrote:
> > On Thu, Jul 01, 2010 at 08:15:33PM -0500, Peter Bergner wrote:
> > > After fixing that, I noticed the fixed code caused a couple of new testsuite
> > > failures that I tracked down to us now setting MASK_PPC_GFXOPT in the
> > > target_flags whenever TARGET_ALTIVEC is enabled.
> > 
> > I think that is wrong.  A 7400 or 7450 (G4) processor has altivec but
> > not the newer form of mfcr, at least if I can read the data sheets
> > correctly.  I think they also use the older y bit for branch hints.
> 
> I had wondered to myself whether we wanted to add that mask, but after
> looking that the 7400 and 7450 already have the MASK_PPC_GFXOPT set
> for -mcpu={7400,7450}, I guess I convinced myself that it was right.
> I guess I need to track down how that two operand form mfcr is being
> generated.

Ok, I tracked down the testsuite failures that were due to us generating
the two operand form of the mfcr instruction.  They ended up all being
test cases where we compiled with "-maltivec -mvsx ...".  The -mvsx
option causes us to add the ISA_2_6_MASKS flags to target_flags which
includes the MASK_MFCRF flag which is how we're getting the two operand
mfcr form.  I guess that means we only have to pass additional gas
options whenever we have -mvsx and not when we only have -maltivec, so the
-maltivec change can be dropped.  That leaves us with the updated patch
below.


Is this ok for trunk once bootstrapping and regtesting are complete?

Peter


	* config/rs6000/rs6000.c (rs6000_override_options): Fix setting of
	default ISA flags.
	* config/rs6000/rs6000.h (ASM_CPU_SPEC): Add -mvsx.
Peter Bergner - July 2, 2010, 7:06 p.m.
On Fri, 2010-07-02 at 11:44 -0500, Peter Bergner wrote:
> Is this ok for trunk once bootstrapping and regtesting are complete?

This just completed powerpc64-linux bootstrapping and regtesting
(-m32 and -m64) with no regressions.

Peter

Patch

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 161490)
+++ config/rs6000/rs6000.c	(working copy)
@@ -2656,11 +2656,11 @@  rs6000_override_options (const char *def
   /* For the newer switches (vsx, dfp, etc.) set some of the older options,
      unless the user explicitly used the -mno-<option> to disable the code.  */
   if (TARGET_VSX)
-    target_flags |= (ISA_2_6_MASKS & (target_flags_explicit & ~ISA_2_6_MASKS));
+    target_flags |= (ISA_2_6_MASKS & ~target_flags_explicit);
   else if (TARGET_DFP)
-    target_flags |= (ISA_2_5_MASKS & (target_flags_explicit & ~ISA_2_5_MASKS));
+    target_flags |= (ISA_2_5_MASKS & ~target_flags_explicit);
   else if (TARGET_ALTIVEC)
-    target_flags |= (MASK_PPC_GFXOPT & (target_flags_explicit & ~MASK_PPC_GFXOPT));
+    target_flags |= (MASK_PPC_GFXOPT & ~target_flags_explicit);
 
   /* Set debug flags */
   if (rs6000_debug_name)
Index: config/rs6000/rs6000.h
===================================================================
--- config/rs6000/rs6000.h	(revision 161490)
+++ config/rs6000/rs6000.h	(working copy)
@@ -159,7 +159,8 @@ 
 %{mcpu=e300c3: -me300} \
 %{mcpu=e500mc: -me500mc} \
 %{mcpu=e500mc64: -me500mc64} \
 %{maltivec: -maltivec} \
+%{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: %(asm_cpu_power7)}} \
 -many"
 
 #define CPP_DEFAULT_SPEC ""