aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-03-07 08:04:38 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-03-07 08:04:38 +0000
commitd4daf46537d393da42834c429523d2acbaef2b1f (patch)
tree5c0a6264e9bcf6fb5da8b83c4d77cd086033575d /gcc/expr.c
parent9483a0a715f7340d53987059c92257f715544f63 (diff)
PR rtl-optimization/79901
* expr.c (expand_expr_real_2): For vector MIN/MAX, if there is no min/max expander, expand it using expand_vec_cond_expr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245946 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 34bbf3d7b47..91d7ea21722 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8943,6 +8943,18 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
if (temp != 0)
return temp;
+ /* For vector MIN <x, y>, expand it a VEC_COND_EXPR <x <= y, x, y>
+ and similarly for MAX <x, y>. */
+ if (VECTOR_TYPE_P (type))
+ {
+ tree t0 = make_tree (type, op0);
+ tree t1 = make_tree (type, op1);
+ tree comparison = build2 (code == MIN_EXPR ? LE_EXPR : GE_EXPR,
+ type, t0, t1);
+ return expand_vec_cond_expr (type, comparison, t0, t1,
+ original_target);
+ }
+
/* At this point, a MEM target is no longer useful; we will get better
code without it. */