Hi! On Fri, Nov 22, 2019 at 01:26:39PM +0800, luoxhu wrote: > Update the code as you wish, Thanks:
The point is to make this interface easy and clear to use. So please tell me what *you* think about that, don't just do what I think may be a good solution! > * gcc.target/powerpc/pr72804.c: Split the store function to... > * gcc.target/powerpc/pr72804-1.c: ... this one. New. Ah, good idea. > +++ b/gcc/testsuite/gcc.target/powerpc/pr72804-1.c > +/* store generates difference instructions as below: > + P9: mtvsrdd;xxlnot;stxv. > + P8/P7/P6 LE: not;not;std;std. > + P8 BE: mtvsrd;mtvsrd;xxpermdi;xxlnor;stxvd2x. > + P7/P6 BE: std;std;addi;lxvd2x;xxlnor;stxvd2x. */ But it should generate just the first or second. So just document that, and base the tests around that as well? > +/* { dg-final { scan-assembler-times {\mmtvsrdd\M} 1 { target power9+ } } } > */ > +/* { dg-final { scan-assembler-times {\mxxlnor\M} 1 { target power9+ } } } */ > +/* { dg-final { scan-assembler-times {\mstxv\M} 1 { target power9+ } } } */ > + > +/* { dg-final { scan-assembler-times {\mnot\M} 2 { xfail {! { {! power9+} && > {le} } } } } } */ > + > +/* { dg-final { scan-assembler-times {\mstd\M} 2 { xfail { { {power8} && > {be} } || {power9+} } } } } */ These shouldn't xfail for p9 and later: it is an *unexpected* failure there. Maybe it is easier to duplicate this test? One for p9+ and one for ! p9+? > +# Return 1 if we're generating code for only power8 platforms. > + > +proc check_effective_target_power8 { } { > + return [check_no_compiler_messages_nocache power8 assembly { > + #if !(!defined(_ARCH_PWR9) && defined(_ARCH_PWR8)) > + #error NO > + #endif > + } ""] > +} Do we need this? > +# Return 1 if we're generating code for power9 and future platforms. > + > +proc check_effective_target_power9+ { } { > + return [check_no_compiler_messages_nocache power9+ assembly { > + #if !(defined(_ARCH_PWR9)) > + #error NO > + #endif > + } ""] > +} Maybe it is useful to have even shorter names, p9+, since room is scarce where it is used (just like le and be). But maybe it doesn't matter? Segher