--- /dev/null
+// { dg-do compile }
+
+void av(float *au)
+{
+ for (int i = 0; i < 1024; ++i)
+ {
+ float t = i;
+ int tt = __builtin_bit_cast(int, t);
+ bool t1 = tt;
+ float t2 = t1;
+ int t3 = __builtin_bit_cast(int, t2);
+ bool t4 = t3;
+ float t5 = t5;
+ au[i] = t4;
+ }
+}
+
+// { dg-final { scan-tree-dump "optimized: loop vectorized" "vect" { target { { vect_uintfloat_cvt && vect_float } && vect_bool_cmp } } } }
hash_set<gimple *> bool_stmts;
if (CONVERT_EXPR_CODE_P (rhs_code)
- || rhs_code == VIEW_CONVERT_EXPR)
+ || rhs_code == VIEW_CONVERT_EXPR
+ || rhs_code == FLOAT_EXPR)
{
- if (! INTEGRAL_TYPE_P (TREE_TYPE (lhs))
- || VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (lhs)))
+ if (VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (lhs)))
return NULL;
vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
pattern_stmt, new_vectype);
lhs = vect_recog_temp_ssa_var (TREE_TYPE (lhs), NULL);
- pattern_stmt = gimple_build_assign (lhs, CONVERT_EXPR, tmp);
+ pattern_stmt
+ = gimple_build_assign (lhs, (rhs_code == FLOAT_EXPR
+ ? FLOAT_EXPR : CONVERT_EXPR), tmp);
}
*type_out = vectype;
}
if (VECTOR_BOOLEAN_TYPE_P (vectype_out)
- && !VECTOR_BOOLEAN_TYPE_P (vectype_in))
+ != VECTOR_BOOLEAN_TYPE_P (vectype_in))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,