Message ID | cba86d60-f597-177c-bf6b-8fab076b06ca@vnet.ibm.com |
---|---|
State | New |
Headers | show |
On Wed, Nov 23, 2016 at 12:13:23PM -0600, Peter Bergner wrote: > --- gcc/config/rs6000/rs6000.h (revision 241976) > +++ gcc/config/rs6000/rs6000.h (working copy) > @@ -1279,9 +1279,11 @@ enum data_align { align_abi, align_opt, > enough space to account for vectors in FP regs. However, TFmode/TDmode > should not use VSX instructions to do a caller save. */ > #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ > - (TARGET_VSX \ > - && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE)) \ > - && FP_REGNO_P (REGNO) \ > + (NREGS <= rs6000_hard_regno_nregs[MODE][REGNO] \ > + ? MODE \ Please put parens around NREGS and that last MODE. > --- gcc/testsuite/gcc.target/powerpc/pr78458.c (revision 0) > +++ gcc/testsuite/gcc.target/powerpc/pr78458.c (working copy) > @@ -0,0 +1,15 @@ > +/* { dg-do compile } */ > +/* { dg-options "-mcpu=8548 -mspe -mabi=spe -mlra" } */ > +/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */ You don't need the default arguments, FWIW. Okay for trunk. Thanks! Segher
On Wed, 23 Nov 2016, Peter Bergner wrote: > Joseph, I copied the testsuite preamble from another SPE test case. > Does it look correct to you to catch the bug? I think the preamble is fine. I'm running execution testing with my two SPE patches and will submit them if results seem reasonable (since the previous state was the build failing, I don't have baseline results for unmodified GCC to compare with).
On 11/23/16 12:33 PM, Segher Boessenkool wrote: > On Wed, Nov 23, 2016 at 12:13:23PM -0600, Peter Bergner wrote: > Please put parens around NREGS and that last MODE. [snip] > You don't need the default arguments, FWIW. > > Okay for trunk. Thanks! Ok, commited as revision 242818 with your suggestions. Thanks. Peter
Index: gcc/config/rs6000/rs6000.h =================================================================== --- gcc/config/rs6000/rs6000.h (revision 241976) +++ gcc/config/rs6000/rs6000.h (working copy) @@ -1279,9 +1279,11 @@ enum data_align { align_abi, align_opt, enough space to account for vectors in FP regs. However, TFmode/TDmode should not use VSX instructions to do a caller save. */ #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ - (TARGET_VSX \ - && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE)) \ - && FP_REGNO_P (REGNO) \ + (NREGS <= rs6000_hard_regno_nregs[MODE][REGNO] \ + ? MODE \ + : TARGET_VSX \ + && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE)) \ + && FP_REGNO_P (REGNO) \ ? V2DFmode \ : TARGET_E500_DOUBLE && (MODE) == SImode \ ? SImode \ Index: gcc/testsuite/gcc.target/powerpc/pr78458.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr78458.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/pr78458.c (working copy) @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mcpu=8548 -mspe -mabi=spe -mlra" } */ +/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */ + +extern void bar (void); +long double +pr78458 (long double p1) +{ + bar (); + asm volatile ("# clobbers" ::: + "r14", "r15", "r16", "r17", "r18", "r19", + "r20", "r21", "r22", "r23", "r24", "r25", + "r26", "r27", "r28", "r29", "r30", "r31"); + return p1; +}