diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2007-05-17 06:31:05 +0000 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2007-05-17 06:31:05 +0000 |
commit | c87e91752884f27ed35eeba0fcdddb1498afa4fe (patch) | |
tree | 89eb8371ed2645bc5faf2ffeb7e859c669317654 /gcc/doc | |
parent | a9c0c45a135e14a90dfb4043e78d6a464006478d (diff) |
PR tree-optimization/24659
* optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
OTI_vec_pack_ufix_trunc.
(vec_unpacks_float_hi_optab): Define new macro.
(vec_unpacks_float_lo_optab): Ditto.
(vec_unpacku_float_hi_optab): Ditto.
(vec_unpacku_float_lo_optab): Ditto.
(vec_pack_sfix_trunc_optab): Ditto.
(vec_pack_ufix_trunc_optab): Ditto.
* genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
and vec_pack_[s|u]fix_trunc_optab using
vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
* tree-vectorizer.c (supportable_widening_operation): Handle
FLOAT_EXPR and CONVERT_EXPR. Update comment.
(supportable_narrowing_operation): New function.
* tree-vectorizer.h (supportable_narrowing_operation): Prototype.
* tree-vect-transform.c (vectorizable_conversion): Handle
(nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
(vect_gen_widened_results_half): Move before vectorizable_conversion.
(vectorizable_type_demotion): Call supportable_narrowing_operation()
to check for target support.
* optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
for VEC_PACK_FIX_TRUNC_EXPR.
(expand_binop): Special case mode of the result for
vec_pack_[u|s]fix_trunc_optab.
(init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
vec_pack_[u|s]fix_trunc_optab.
* tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
* tree-pretty-print.c (dump_generic_node): Handle
VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
VEC_PACK_FIX_TRUNC_EXPR.
(op_prio): Ditto.
* expr.c (expand_expr_real_1): Ditto.
* tree-inline.c (estimate_num_insns_1): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Ditto.
* config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
(vec_unpacks_float_lo_v8hi): Ditto.
(vec_unpacku_float_hi_v8hi): Ditto.
(vec_unpacku_float_lo_v8hi): Ditto.
(vec_unpacks_float_hi_v4si): Ditto.
(vec_unpacks_float_lo_v4si): Ditto.
(vec_pack_sfix_trunc_v2df): Ditto.
* doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
Document.
[VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
[VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
* doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
[vec_pack_ufix_trunc]: Ditto.
[vec_unpacks_float_hi]: Ditto.
[vec_unpacks_float_lo]: Ditto.
[vec_unpacku_float_hi]: Ditto.
[vec_unpacku_float_lo]: Ditto.
testsuite/ChangeLog:
PR tree-optimization/24659
* gcc.dg/vect/vect-floatint-conversion-2.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
not vect_int target.
* gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
not vect_int target. Loop is vectorized for vect_intfloat_cvt
targets.
* gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@124784 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/c-tree.texi | 23 | ||||
-rw-r--r-- | gcc/doc/md.texi | 23 |
2 files changed, 45 insertions, 1 deletions
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi index 60482e4626c..bd4c62308ee 100644 --- a/gcc/doc/c-tree.texi +++ b/gcc/doc/c-tree.texi @@ -1983,8 +1983,11 @@ This macro returns the attributes on the type @var{type}. @tindex VEC_WIDEN_MULT_LO_EXPR @tindex VEC_UNPACK_HI_EXPR @tindex VEC_UNPACK_LO_EXPR +@tindex VEC_UNPACK_FLOAT_HI_EXPR +@tindex VEC_UNPACK_FLOAT_LO_EXPR @tindex VEC_PACK_TRUNC_EXPR @tindex VEC_PACK_SAT_EXPR +@tindex VEC_PACK_FIX_TRUNC_EXPR @tindex VEC_EXTRACT_EVEN_EXPR @tindex VEC_EXTRACT_ODD_EXPR @tindex VEC_INTERLEAVE_HIGH_EXPR @@ -2846,6 +2849,17 @@ high @code{N/2} elements of the vector are extracted and widened (promoted). In the case of @code{VEC_UNPACK_LO_EXPR} the low @code{N/2} elements of the vector are extracted and widened (promoted). +@item VEC_UNPACK_FLOAT_HI_EXPR +@item VEC_UNPACK_FLOAT_LO_EXPR +These nodes represent unpacking of the high and low parts of the input vector, +where the values are converted from fixed point to floating point. The +single operand is a vector that contains @code{N} elements of the same +integral type. The result is a vector that contains half as many elements +of a floating point type whose size is twice as wide. In the case of +@code{VEC_UNPACK_HI_EXPR} the high @code{N/2} elements of the vector are +extracted, converted and widened. In the case of @code{VEC_UNPACK_LO_EXPR} +the low @code{N/2} elements of the vector are extracted, converted and widened. + @item VEC_PACK_TRUNC_EXPR This node represents packing of truncated elements of the two input vectors into the output vector. Input operands are vectors that contain the same @@ -2862,6 +2876,15 @@ vector that contains twice as many elements of an integral type whose size is half as wide. The elements of the two vectors are demoted and merged (concatenated) to form the output vector. +@item VEC_PACK_FIX_TRUNC_EXPR +This node represents packing of elements of the two input vectors into the +output vector, where the values are converted from floating point +to fixed point. Input operands are vectors that contain the same number +of elements of a floating point type. The result is a vector that contains +twice as many elements of an integral type whose size is half as wide. The +elements of the two vectors are merged (concatenated) to form the output +vector. + @item VEC_EXTRACT_EVEN_EXPR @item VEC_EXTRACT_ODD_EXPR These nodes represent extracting of the even/odd elements of the two input diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index 53c5769f788..029657d3fe0 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -3607,6 +3607,14 @@ Operand 0 is the resulting vector in which the elements of the two input vectors are concatenated after narrowing them down using signed/unsigned saturating arithmetic. +@cindex @code{vec_pack_sfix_trunc_@var{m}} instruction pattern +@cindex @code{vec_pack_ufix_trunc_@var{m}} instruction pattern +@item @samp{vec_pack_sfix_trunc_@var{m}}, @samp{vec_pack_ufix_trunc_@var{m}} +Narrow, convert to signed/unsigned integral type and merge the elements +of two vectors. Operands 1 and 2 are vectors of the same mode having N +floating point elements of size S. Operand 0 is the resulting vector +in which 2*N elements of size N/2 are concatenated. + @cindex @code{vec_unpacks_hi_@var{m}} instruction pattern @cindex @code{vec_unpacks_lo_@var{m}} instruction pattern @item @samp{vec_unpacks_hi_@var{m}}, @samp{vec_unpacks_lo_@var{m}} @@ -3624,11 +3632,24 @@ integral elements. The input vector (operand 1) has N elements of size S. Widen (promote) the high/low elements of the vector using zero extension and place the resulting N/2 values of size 2*S in the output vector (operand 0). +@cindex @code{vec_unpacks_float_hi_@var{m}} instruction pattern +@cindex @code{vec_unpacks_float_lo_@var{m}} instruction pattern +@cindex @code{vec_unpacku_float_hi_@var{m}} instruction pattern +@cindex @code{vec_unpacku_float_lo_@var{m}} instruction pattern +@item @samp{vec_unpacks_float_hi_@var{m}}, @samp{vec_unpacks_float_lo_@var{m}} +@itemx @samp{vec_unpacku_float_hi_@var{m}}, @samp{vec_unpacku_float_lo_@var{m}} +Extract, convert to floating point type and widen the high/low part of a +vector of signed/unsigned integral elements. The input vector (operand 1) +has N elements of size S. Convert the high/low elements of the vector using +floating point conversion and place the resulting N/2 values of size 2*S in +the output vector (operand 0). + @cindex @code{vec_widen_umult_hi_@var{m}} instruction pattern @cindex @code{vec_widen_umult_lo__@var{m}} instruction pattern @cindex @code{vec_widen_smult_hi_@var{m}} instruction pattern @cindex @code{vec_widen_smult_lo_@var{m}} instruction pattern -@item @samp{vec_widen_umult_hi_@var{m}}, @samp{vec_widen_umult_lo_@var{m}}, @samp{vec_widen_smult_hi_@var{m}}, @samp{vec_widen_smult_lo_@var{m}} +@item @samp{vec_widen_umult_hi_@var{m}}, @samp{vec_widen_umult_lo_@var{m}} +@itemx @samp{vec_widen_smult_hi_@var{m}}, @samp{vec_widen_smult_lo_@var{m}} Signed/Unsigned widening multiplication. The two inputs (operands 1 and 2) are vectors with N signed/unsigned elements of size S. Multiply the high/low elements of the two vectors, and put the N/2 products of size 2*S in the |