aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index be2d6b3..8dba4d0 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1851,10 +1851,17 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
gcc_unreachable ();
}
- *code1 = c1;
- *code2 = c2;
- optab1 = optab_for_tree_code (c1, vectype);
- optab2 = optab_for_tree_code (c2, vectype);
+ if (code == FIX_TRUNC_EXPR)
+ {
+ /* The signedness is determined from output operand. */
+ optab1 = optab_for_tree_code (c1, type);
+ optab2 = optab_for_tree_code (c2, type);
+ }
+ else
+ {
+ optab1 = optab_for_tree_code (c1, vectype);
+ optab2 = optab_for_tree_code (c2, vectype);
+ }
if (!optab1 || !optab2)
return false;
@@ -1867,6 +1874,8 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype,
|| insn_data[icode2].operand[0].mode != TYPE_MODE (wide_vectype))
return false;
+ *code1 = c1;
+ *code2 = c2;
return true;
}
@@ -1918,8 +1927,11 @@ supportable_narrowing_operation (enum tree_code code,
gcc_unreachable ();
}
- *code1 = c1;
- optab1 = optab_for_tree_code (c1, vectype);
+ if (code == FIX_TRUNC_EXPR)
+ /* The signedness is determined from output operand. */
+ optab1 = optab_for_tree_code (c1, type);
+ else
+ optab1 = optab_for_tree_code (c1, vectype);
if (!optab1)
return false;
@@ -1929,6 +1941,7 @@ supportable_narrowing_operation (enum tree_code code,
|| insn_data[icode1].operand[0].mode != TYPE_MODE (narrow_vectype))
return false;
+ *code1 = c1;
return true;
}