[PATCH, vectorizer]: Take2: Vectorize FP conversions

Uros Bizjak ubizjak@gmail.com
Fri Apr 20 08:09:00 GMT 2007


Hello!

This is the second revision of the FP conversions patch. In addition
to conversions, this patch renames VEC_PACK_MOD_EXPR (and
corresponding optabs) to VEC_PACK_TRUNC_OPTAB. Following this rename,
vec_pack_trunc_optab also handles FP modes, so we don't have to invent
another trunc optab just for floating modes.

For bonus points, this patch also adds/updates the documentation.

Additionally, we can add vec_pack_sfix_optab to handle i.e. i386
cvtpd2dq (convert V2DFmode into V4SI mode) and vice versa for
vec_pack_float_optab for cvtdq2pd.
I'll add this functionality as a follow-on patch.

Patch was bootstrapped on i686-pc-linux-gnu and regresison tested for
all default languages. OK for mainline?

2007-04-20  Uros Bizjak  <ubizjak@gmail.com>

	PR tree-optimization/24659
        * optabs.h (enum optab_index): Add OTI_vec_unpack_hi and
	OTI_vec_unpack_lo.  Rename OTI_vec_pack_mod to OTI_vec_pack_trunc.
	(vec_unpack_hi_optab): Define new macro.
	(vec_unpack_lo_optab): Ditto.
	(vec_pack_trunc_optab): Rename from vec_pack_mod_optab.
	* genopinit.c (optabs): Implement vec_unpack_hi_optab using
	vec_unpack_hi_* patterns.  Implement vec_unpack_lo_optab
	using vec_unpack_lo_* patterns.  Rename vec_pack_mod_optab
	to vec_pack_trunc_optab.
	* tree-vect-transform.c (vectorizable_type_demotion): Do not fail
	early for scalar floating point operands for NOP_EXPR.
	(vectorizable_type_promotion): Ditto.
	* optabs.c (optab_for_tree_code) [VEC_UNPACK_HI_EXPR] Return
	vec_unpack_hi_optab for FLOAT_TYPE type.
	[VEC_UNPACK_HI_EXPR]: Return vec_unpack_lo_optab for
	FLOAT_TYPE type.
	[VEC_PACK_TRUNC_EXPR]: Return vec_pack_trunc_optab.
	(expand_binop): Rename vec_float_trunc_optab to vec_pack_mod_optab.
	(init_optabs): Initialize vec_unpack_hi_optab,
	vec_unpack_lo_optab and vec_pack_trunc_optab.

	* tree.def (VEC_PACK_TRUNC_EXPR): Rename from VEC_PACK_MOD_EXPR.
	* tree-pretty-print.c (dump_generic_node) [VEC_PACK_TRUNC_EXPR]:
	Rename from VEC_PACK_MOD_EXPR.
	(op_prio) [VEC_PACK_TRUNC_EXPR]: 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_unpack_hi_v4sf): New expander.
	(vec_unpack_lo_v4sf): Ditto.
	(vec_pack_trunc_v2df): Ditto.
	(vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi.
	(vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si.
	(vec_pack_trunc_v2di): Rename from vec_pack_mod_v2di.
	
	* config/rs6000/altivec.md (vec_pack_trunc_v8hi): Rename from
	vec_pack_mod_v8hi.
	(vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si.

	* doc/c-tree.texi (Expression trees) [VEC_PACK_TRUNC_EXPR]:
	Rename from VEC_PACK_MOD_EXPR.  This expression also represent
	packing of floating point operands.
	[VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR]: These expression also
	represent unpacking of floating point operands.
	* doc/md.texi (Standard Names) [vec_pack_trunc]: Update documentation.
	[vec_unpack_hi]: Document.
	[vec_unpack_lo]: Ditto.

testsuite/ChangeLog:

2007-04-19  Uros Bizjak  <ubizjak@gmail.com>

	PR tree-optimization/24659
	* gcc.dg/vect/vect-float-extend-1.c: New test.
	* gcc.dg/vect/vect-float-truncate-1.c: New test.

Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vect-conv.diff
Type: application/octet-stream
Size: 9685 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070420/ac903580/attachment.obj>


More information about the Gcc-patches mailing list