+2016-03-18 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ PR tree-optimization/70252
+ * tree-vect-stmts.c (supportable_widening_operation): Check resulting
+ boolean vector has a proper number of elements.
+ (supportable_narrowing_operation): Likewise.
+
2016-03-18 Tom de Vries <tom@codesourcery.com>
PR ipa/70269
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-march=skylake-avx512" { target { i?86-*-* x86_64-*-* } } } */
+
+extern unsigned char a [150];
+extern unsigned char b [150];
+extern unsigned char c [150];
+extern unsigned char d [150];
+extern unsigned char e [150];
+
+void foo () {
+ for (int i = 92; i <= 141; i += 2) {
+ int tmp = (d [i] && b [i]) <= (a [i] > c [i]);
+ e [i] = tmp >> b [i];
+ }
+}
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
+ /* For scalar masks we may have different boolean
+ vector types having the same QImode. Thus we
+ add additional check for elements number. */
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (vectype) / 2
+ == TYPE_VECTOR_SUBPARTS (wide_vectype)));
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
if (insn_data[icode1].operand[0].mode == TYPE_MODE (wide_vectype)
&& insn_data[icode2].operand[0].mode == TYPE_MODE (wide_vectype))
- return true;
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (intermediate_type) / 2
+ == TYPE_VECTOR_SUBPARTS (wide_vectype)));
prev_type = intermediate_type;
prev_mode = intermediate_mode;
*code1 = c1;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
+ /* For scalar masks we may have different boolean
+ vector types having the same QImode. Thus we
+ add additional check for elements number. */
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (vectype) * 2
+ == TYPE_VECTOR_SUBPARTS (narrow_vectype)));
/* Check if it's a multi-step conversion that can be done using intermediate
types. */
(*multi_step_cvt)++;
if (insn_data[icode1].operand[0].mode == TYPE_MODE (narrow_vectype))
- return true;
+ return (!VECTOR_BOOLEAN_TYPE_P (vectype)
+ || (TYPE_VECTOR_SUBPARTS (intermediate_type) * 2
+ == TYPE_VECTOR_SUBPARTS (narrow_vectype)));
prev_mode = intermediate_mode;
prev_type = intermediate_type;