From 337d2167ccf01c028e993852f6d3a4681a021505 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Thu, 5 Nov 2015 12:21:33 +0000 Subject: [PATCH] tree-vect-generic.c (do_compare): Use -1 for true result instead of 1. gcc/ * tree-vect-generic.c (do_compare): Use -1 for true result instead of 1. From-SVN: r229808 --- gcc/ChangeLog | 5 +++++ gcc/tree-vect-generic.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 60ad78a2170..c7b238ba2c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-11-05 Ilya Enkovich + + * tree-vect-generic.c (do_compare): Use -1 for true + result instead of 1. + 2015-11-05 Ramana Radhakrishnan * config/aarch64/aarch64.c diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index 4e96e87d02d..c64fdc4d46a 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -154,10 +154,16 @@ static tree do_compare (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b, tree bitpos, tree bitsize, enum tree_code code, tree type) { + tree stype = TREE_TYPE (type); + tree cst_false = build_zero_cst (stype); + tree cst_true = build_all_ones_cst (stype); + tree cmp; + a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos); b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos); - return gimplify_build2 (gsi, code, TREE_TYPE (type), a, b); + cmp = build2 (code, boolean_type_node, a, b); + return gimplify_build3 (gsi, COND_EXPR, stype, cmp, cst_true, cst_false); } /* Expand vector addition to scalars. This does bit twiddling -- 2.30.2