This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][PING] Vectorize conversions directly


On 10/20/2011 09:24 AM, Dmitry Plotnikov wrote:
> gcc/
>     * tree-cfg.c (verify_gimple_assign_unary): Allow vector conversions.
>     * tree-vect-stmts.c (supportable_convert_operation): New function.
>       (vectorizable_conversion): Call it.  Change condition and behavior
>       for NONE modifier case.
>     * tree-vectorizer.h (supportable_convert_operation): New prototype.
>     * tree.h (VECTOR_INTEGER_TYPE_P): New macro.
> 
> gcc/config/arm/
>     * neon.md (floatv2siv2sf2): New.
>       (floatunsv2siv2sf2): New.
>       (fix_truncv2sfv2si2): New.
>       (fix_truncunsv2sfv2si2): New.
>       (floatv4siv4sf2): New.
>       (floatunsv4siv4sf2): New.
>       (fix_truncv4sfv4si2): New.
>       (fix_truncunsv4sfv4si2): New.
>    
> gcc/testsuite/
>     * gcc.target/arm/vect-vcvt.c: New test.
>     * gcc.target/arm/vect-vcvtq.c: New test.
> 
> gcc/testsuite/lib/
>     * target-supports.exp (check_effective_target_vect_intfloat_cvt): True
>       for ARM NEON.
>       (check_effective_target_vect_uintfloat_cvt): Likewise.
>       (check_effective_target_vect_intfloat_cvt): Likewise.
>       (check_effective_target_vect_floatuint_cvt): Likewise.
>       (check_effective_target_vect_floatint_cvt): Likewise.
>       (check_effective_target_vect_extract_even_odd): Likewise.

Please move supportable_convert_operation to optabs.c; eventually
we ought to use can_fix_p/can_float_p.

> +  if (code == FIX_TRUNC_EXPR)
> +    optab1 = (TYPE_UNSIGNED (vectype_out)) ? ufixtrunc_optab : sfixtrunc_optab;
> +  else if (code == FLOAT_EXPR)
> +    optab1 = (TYPE_UNSIGNED (vectype_in)) ? ufloat_optab : sfloat_optab;
> +  
> +  m1 = TYPE_MODE (vectype_in);

Looks like a missing 

	else
	  gcc_unreachable()

there, since there's no check for optab1 != NULL later.

Otherwise the generic parts of the patch look good.
Please get separate approval for the arm portions of the patch.

After the generic parts of the patch goes in I will endevour to adjust the i386
and rs6000 backends to similarly populate the optabs, so that we can remove the
builtin path here.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]