diff options
author | alalaw01 <alalaw01@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-14 10:48:34 +0000 |
---|---|---|
committer | alalaw01 <alalaw01@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-14 10:48:34 +0000 |
commit | fb6b80a0487df54ce03f20766283b5a975472b42 (patch) | |
tree | 11269bbc5bc8d4449b8484d7fccf11158c77490f /gcc/tree-vect-loop.c | |
parent | a6cab7d490946fbcdf439eaec3886946a4bd2d6a (diff) | |
download | gcc-fb6b80a0487df54ce03f20766283b5a975472b42.tar.gz |
[Vectorizer]Make reductions-via-shifts and vec_shr_optab endianness-neutral
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 7aa58623207..5e66dcf5354 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -3092,7 +3092,7 @@ calc_vec_perm_mask_for_shift (enum machine_mode mode, unsigned int offset, 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 @@ -3907,7 +3907,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt, 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; @@ -4417,14 +4417,8 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt, 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); |