summaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-06 17:12:19 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-06 17:12:19 +0000
commitcaa8f87693ed3bff39e2c18c154cce3e9484e961 (patch)
treead1dad19bfc638b95c35eeb1027b7f5e7a4a87b2 /gcc/optabs.c
parent3249762825f0bb54a680feea767122f41bf2f094 (diff)
downloadgcc-caa8f87693ed3bff39e2c18c154cce3e9484e961.tar.gz
vshuffle: Use correct mode for mask operand.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179622 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 3a52fb0c07c..aa233d5058a 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6650,9 +6650,8 @@ expand_vec_shuffle_expr (tree type, tree v0, tree v1, tree mask, rtx target)
struct expand_operand ops[4];
enum insn_code icode;
enum machine_mode mode = TYPE_MODE (type);
- rtx rtx_v0, rtx_mask;
- gcc_assert (expand_vec_shuffle_expr_p (mode, v0, v1, mask));
+ gcc_checking_assert (expand_vec_shuffle_expr_p (mode, v0, v1, mask));
if (TREE_CODE (mask) == VECTOR_CST)
{
@@ -6675,24 +6674,23 @@ expand_vec_shuffle_expr (tree type, tree v0, tree v1, tree mask, rtx target)
return expand_expr_real_1 (call, target, VOIDmode, EXPAND_NORMAL, NULL);
}
-vshuffle:
+ vshuffle:
icode = direct_optab_handler (vshuffle_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
- rtx_mask = expand_normal (mask);
-
create_output_operand (&ops[0], target, mode);
- create_input_operand (&ops[3], rtx_mask, mode);
+ create_input_operand (&ops[3], expand_normal (mask),
+ TYPE_MODE (TREE_TYPE (mask)));
if (operand_equal_p (v0, v1, 0))
{
- rtx_v0 = expand_normal (v0);
- if (!insn_operand_matches(icode, 1, rtx_v0))
+ rtx rtx_v0 = expand_normal (v0);
+ if (!insn_operand_matches (icode, 1, rtx_v0))
rtx_v0 = force_reg (mode, rtx_v0);
- gcc_checking_assert(insn_operand_matches(icode, 2, rtx_v0));
+ gcc_checking_assert (insn_operand_matches (icode, 2, rtx_v0));
create_fixed_operand (&ops[1], rtx_v0);
create_fixed_operand (&ops[2], rtx_v0);