Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-19 Thread Richard Biener
On Tue, Mar 19, 2013 at 9:06 AM, Marc Glisse wrote: > Hello, > > new version of the patch. Note that for the simplification from {-1,-1}?a:b > to a, I removed the test that b has no side effects and call > pedantic_omit_one_operand_loc instead. > > > Bootstrap + testsuite on x86_64-linux-gnu. Ok.

Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-19 Thread Marc Glisse
Hello, new version of the patch. Note that for the simplification from {-1,-1}?a:b to a, I removed the test that b has no side effects and call pedantic_omit_one_operand_loc instead. Bootstrap + testsuite on x86_64-linux-gnu. 2013-03-19 Marc Glisse gcc/ * tree.h (VECTOR_TYPE_P):

Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-18 Thread Richard Biener
On Mon, Mar 18, 2013 at 12:06 PM, Marc Glisse wrote: > On Mon, 18 Mar 2013, Richard Biener wrote: > >> On Mon, Mar 18, 2013 at 11:27 AM, Marc Glisse >> wrote: >>> >>> On Mon, 18 Mar 2013, Richard Biener wrote: You mean that the VEC_COND_EXPRs can never be used as an lvalue in the C

Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-18 Thread Marc Glisse
On Mon, 18 Mar 2013, Richard Biener wrote: On Mon, Mar 18, 2013 at 11:27 AM, Marc Glisse wrote: On Mon, 18 Mar 2013, Richard Biener wrote: You mean that the VEC_COND_EXPRs can never be used as an lvalue in the C++ frontend? Yes, as I mention in the ChangeLog. Not just the C++ front-end, it

Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-18 Thread Richard Biener
On Mon, Mar 18, 2013 at 11:27 AM, Marc Glisse wrote: > On Mon, 18 Mar 2013, Richard Biener wrote: > >>> 2013-03-17 Marc Glisse >>> >>> gcc/ >>> * fold-const.c (fold_cond_expr_with_comparison): Use >>> build_zero_cst. >>> VEC_COND_EXPR cannot be lvalues. >>> (fold_ternary

Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-18 Thread Marc Glisse
On Mon, 18 Mar 2013, Richard Biener wrote: 2013-03-17 Marc Glisse gcc/ * fold-const.c (fold_cond_expr_with_comparison): Use build_zero_cst. VEC_COND_EXPR cannot be lvalues. (fold_ternary_loc) : Call fold_cond_expr_with_comparison. gcc/cp/ * call.c (build_cond

Re: Fold VEC_COND_EXPR to abs, min, max

2013-03-18 Thread Richard Biener
On Sun, Mar 17, 2013 at 4:46 PM, Marc Glisse wrote: > Hello, > > this patch adds a bit of folding to VEC_COND_EXPR so it is possible to > generate ABS_EXPR and MAX_EXPR for vectors without relying on the > vectorizer. I would have preferred to merge the COND_EXPR and VEC_COND_EXPR > cases, but the

Fold VEC_COND_EXPR to abs, min, max

2013-03-17 Thread Marc Glisse
Hello, this patch adds a bit of folding to VEC_COND_EXPR so it is possible to generate ABS_EXPR and MAX_EXPR for vectors without relying on the vectorizer. I would have preferred to merge the COND_EXPR and VEC_COND_EXPR cases, but there are too many things that need fixing first, so I just co