* [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled.
@ 2010-07-02 1:16 Peter Bergner
2010-07-02 3:25 ` Alan Modra
0 siblings, 1 reply; 5+ messages in thread
From: Peter Bergner @ 2010-07-02 1:16 UTC (permalink / raw)
To: gcc-patches; +Cc: David Edelsohn, Michael Meissner
While looking through the powerpc64-linux testsuite failures, I noticed
that Mike's reciprocal estimate patches caused the vsx-vector-{5,6}.c
test cases to fail because of a typo in rs6000_override_options.
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. This causes us to start
generating the two operand form of the mfcr instruction which gas only
accepts with -mpower4 or later. I fixed that by passing -mpower4 to gas
whenever we use gcc's -maltivec option, unless we've explicitly passed
-mcpu=XXX. I also added similar support for -mvsx.
Bootstrapped and regtested on powerpc64-linux with no new regressions and
vsx-vector-{5,6}.c test cases now passing. Ok for mainline once the slush
is over?
Peter
* config/rs6000/rs6000.c (rs6000_override_options): Fix setting of
default ISA flags.
* config/rs6000/rs6000.h (ASM_CPU_SPEC) <-maltivec>: Pass -mpower4
by default.
<-mvsx>: Add.
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} \
+%{maltivec: -maltivec %{!mcpu*: %{!mvsx: -mpower4}}} \
+%{mvsx: -mvsx %{!maltivec: -maltivec} %{!mcpu*: %(asm_cpu_power7)}} \
-many"
#define CPP_DEFAULT_SPEC ""
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled.
2010-07-02 1:16 [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled Peter Bergner
@ 2010-07-02 3:25 ` Alan Modra
2010-07-02 3:48 ` Peter Bergner
0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2010-07-02 3:25 UTC (permalink / raw)
To: Peter Bergner; +Cc: gcc-patches, David Edelsohn, Michael Meissner
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.
> This causes us to start
> generating the two operand form of the mfcr instruction which gas only
> accepts with -mpower4 or later. I fixed that by passing -mpower4 to gas
> whenever we use gcc's -maltivec option, unless we've explicitly passed
> -mcpu=XXX.
So that would also make this wrong..
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled.
2010-07-02 3:25 ` Alan Modra
@ 2010-07-02 3:48 ` Peter Bergner
2010-07-02 16:45 ` Peter Bergner
0 siblings, 1 reply; 5+ messages in thread
From: Peter Bergner @ 2010-07-02 3:48 UTC (permalink / raw)
To: Alan Modra; +Cc: gcc-patches, David Edelsohn, Michael Meissner
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.
Thanks.
Peter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled.
2010-07-02 3:48 ` Peter Bergner
@ 2010-07-02 16:45 ` Peter Bergner
2010-07-02 19:06 ` Peter Bergner
0 siblings, 1 reply; 5+ messages in thread
From: Peter Bergner @ 2010-07-02 16:45 UTC (permalink / raw)
To: Alan Modra; +Cc: gcc-patches, David Edelsohn, Michael Meissner
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.
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 ""
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled.
2010-07-02 16:45 ` Peter Bergner
@ 2010-07-02 19:06 ` Peter Bergner
0 siblings, 0 replies; 5+ messages in thread
From: Peter Bergner @ 2010-07-02 19:06 UTC (permalink / raw)
To: Alan Modra; +Cc: gcc-patches, David Edelsohn, Michael Meissner
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-02 19:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-02 1:16 [PATCH, rs6000] Fix setting of target_flags when TARGET_{VSX,DFP,ALTIVEC} is enabled Peter Bergner
2010-07-02 3:25 ` Alan Modra
2010-07-02 3:48 ` Peter Bergner
2010-07-02 16:45 ` Peter Bergner
2010-07-02 19:06 ` Peter Bergner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).