From: Ilya Enkovich Date: Fri, 11 Dec 2015 09:43:52 +0000 (+0000) Subject: i386.c (ix86_get_mask_mode): Use scalar modes for 32 and 16 byte boolean vectors... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da33235f3705746d34977153731f97032c24186b;p=gcc.git i386.c (ix86_get_mask_mode): Use scalar modes for 32 and 16 byte boolean vectors when possible. gcc/ * config/i386/i386.c (ix86_get_mask_mode): Use scalar modes for 32 and 16 byte boolean vectors when possible. gcc/testsuite/ * gcc.dg/vect/vect-32-chars.c: New test. From-SVN: r231553 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ab875851c89..bc3f17201d0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-11 Ilya Enkovich + + * config/i386/i386.c (ix86_get_mask_mode): Use scalar + modes for 32 and 16 byte boolean vectors when possible. + 2015-12-11 Segher Boessenkool PR rtl-optimization/67778 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d30fbff7af4..e565c0bc643 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -53533,7 +53533,8 @@ ix86_get_mask_mode (unsigned nunits, unsigned vector_size) unsigned elem_size = vector_size / nunits; /* Scalar mask case. */ - if (TARGET_AVX512F && vector_size == 64) + if ((TARGET_AVX512F && vector_size == 64) + || (TARGET_AVX512VL && (vector_size == 32 || vector_size == 16))) { if (elem_size == 4 || elem_size == 8 || TARGET_AVX512BW) return smallest_mode_for_size (nunits, MODE_INT); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 72570461492..9550dc22ecd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-12-11 Ilya Enkovich + + * gcc.dg/vect/vect-32-chars.c: New test. + 2015-12-11 Jan Hubicka PR ipa/61886 diff --git a/gcc/testsuite/gcc.dg/vect/vect-32-chars.c b/gcc/testsuite/gcc.dg/vect/vect-32-chars.c new file mode 100644 index 00000000000..0af5d2d19b4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-32-chars.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-mavx512bw -mavx512vl" { target { i?86-*-* x86_64-*-* } } } */ + +char a[32]; +char b[32]; +char c[32]; + +void test() +{ + int i = 0; + for (i = 0; i < 32; i++) + if (b[i] > 0) + a[i] = c[i]; +} + +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { i?86-*-* x86_64-*-* } } } } */