This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][PING] Vectorize conversions directly
- From: Richard Henderson <rth at redhat dot com>
- To: Dmitry Plotnikov <dplotnikov at ispras dot ru>
- Cc: gcc-patches at gcc dot gnu dot org, IRAR at il dot ibm dot com, rearnsha at arm dot com, dm at ispras dot ru
- Date: Thu, 20 Oct 2011 09:39:50 -0700
- Subject: Re: [PATCH][PING] Vectorize conversions directly
- References: <4CED2DDC.1020604@ispras.ru> <4CED3095.60201@ispras.ru> <4CF02246.4090606@redhat.com> <4D00D204.3080300@ispras.ru> <4D024B37.80908@redhat.com> <4EA04B20.1090009@ispras.ru>
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~