--- /dev/null
+/* PR target/95713 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-psabi -w" } */
+/* { dg-additional-options "-mavx512bw" { target i?86-*-* x86_64-*-* } } */
+
+typedef int v2si __attribute__((vector_size (8)));
+typedef short int v2hi __attribute__((vector_size (4)));
+void foo (v2hi);
+
+void
+bar (v2si x)
+{
+ v2hi a = (v2hi) { (short) x[0], (short) x[1] };
+ foo (4 > a);
+}
&& (dblvectype
= build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])),
nelts * 2))
- /* Only use it for vector modes or for vector booleans represented
- as scalar bitmasks. See PR95528. */
+ /* Only use it for vector modes or for vector booleans
+ represented as scalar bitmasks. See PR95528. */
&& (VECTOR_MODE_P (TYPE_MODE (dblvectype))
|| VECTOR_BOOLEAN_TYPE_P (dblvectype))
&& (optab = optab_for_tree_code (FLOAT_TYPE_P (TREE_TYPE (type))
= build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])),
nelts / 2))
/* Only use it for vector modes or for vector booleans
- represented as scalar bitmasks, or allow halfvectype
- be the element mode. See PR95528. */
+ represented as scalar bitmasks. See PR95528. */
&& (VECTOR_MODE_P (TYPE_MODE (halfvectype))
- || VECTOR_BOOLEAN_TYPE_P (halfvectype)
- || (TYPE_MODE (halfvectype)
- == TYPE_MODE (TREE_TYPE (halfvectype))))
+ || VECTOR_BOOLEAN_TYPE_P (halfvectype))
&& (optab = optab_for_tree_code (VEC_PACK_TRUNC_EXPR,
halfvectype,
optab_default))