+2014-11-13 Alan Lawrence <alan.lawrence@arm.com>
+
+ * optabs.c (shift_amt_for_vec_perm_mask): Remove code conditional on
+ BYTES_BIG_ENDIAN.
+ * tree-vect-loop.c (calc_vec_perm_mask_for_shift,
+ vect_create_epilog_for_reduction): Likewise.
+ * doc/md.texi (vec_shr_m): Clarify direction of shifting.
+
2014-11-14 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/63724
@cindex @code{vec_shr_@var{m}} instruction pattern
@item @samp{vec_shr_@var{m}}
-Whole vector right shift in bits.
+Whole vector right shift in bits, i.e. towards element 0.
Operand 1 is a vector to be shifted.
Operand 2 is an integer shift amount in bits.
Operand 0 is where the resulting shifted vector is stored.
unsigned int i, nelt = GET_MODE_NUNITS (mode);
for (i = 0; i < nelt; i++)
- sel[i] = (BYTES_BIG_ENDIAN ? i - offset : i + offset) & (2*nelt - 1);
+ sel[i] = (i + offset) & (2*nelt - 1);
}
/* Checks whether the target supports whole-vector shifts for vectors of mode
gimple epilog_stmt = NULL;
enum tree_code code = gimple_assign_rhs_code (stmt);
gimple exit_phi;
- tree bitsize, bitpos;
+ tree bitsize;
tree adjustment_def = NULL;
tree vec_initial_def = NULL;
tree reduction_op, expr, def;
dump_printf_loc (MSG_NOTE, vect_location,
"extract scalar result\n");
- if (BYTES_BIG_ENDIAN)
- bitpos = size_binop (MULT_EXPR,
- bitsize_int (TYPE_VECTOR_SUBPARTS (vectype) - 1),
- TYPE_SIZE (scalar_type));
- else
- bitpos = bitsize_zero_node;
-
- rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp, bitsize, bitpos);
+ rhs = build3 (BIT_FIELD_REF, scalar_type,
+ new_temp, bitsize, bitsize_zero_node);
epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
gimple_assign_set_lhs (epilog_stmt, new_temp);