This patch adds a target selector that says whether the target supports IFN_MASK_STORE.
2017-11-03 Richard Sandiford <richard.sandif...@linaro.org> Alan Hayward <alan.hayw...@arm.com> David Sherwood <david.sherw...@arm.com> gcc/ * doc/sourcebuild.texi (vect_masked_store): Document. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_vect_masked_store): New proc. * gcc.dg/vect/vect-cselim-1.c (foo): Mention that the second loop is vectorizable with masked stores. Update scan-tree-dump-times accordingly. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi 2017-11-03 16:06:56.516976666 +0000 +++ gcc/doc/sourcebuild.texi 2017-11-03 16:07:00.028331940 +0000 @@ -1403,6 +1403,9 @@ Target supports hardware vectors of @cod @item vect_long_long Target supports hardware vectors of @code{long long}. +@item vect_masked_store +Target supports vector masked stores. + @item vect_aligned_arrays Target aligns arrays to vector alignment boundary. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp 2017-11-03 16:06:56.519977825 +0000 +++ gcc/testsuite/lib/target-supports.exp 2017-11-03 16:07:00.029332326 +0000 @@ -6433,6 +6433,12 @@ proc check_effective_target_vect_load_la return $et_vect_load_lanes } +# Return 1 if the target supports vector masked stores. + +proc check_effective_target_vect_masked_store { } { + return 0 +} + # Return 1 if the target supports vector conditional operations, 0 otherwise. proc check_effective_target_vect_condition { } { Index: gcc/testsuite/gcc.dg/vect/vect-cselim-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-cselim-1.c 2015-06-02 23:53:38.000000000 +0100 +++ gcc/testsuite/gcc.dg/vect/vect-cselim-1.c 2017-11-03 16:07:00.028331940 +0000 @@ -38,7 +38,7 @@ foo () } } - /* Not vectorizable. */ + /* Only vectorizable with masked stores. */ for (i = 0; i < N; i++) { c = in1[i].b; @@ -82,4 +82,5 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_masked_store } xfail { { vect_no_align && { ! vect_hw_misalign } } || { ! vect_strided2 } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_masked_store } } } } */