This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Regression Failures after defining TARGET_VECTOR_MODE_SUPPORTED_P
- From: Ian Lance Taylor <iant at google dot com>
- To: Ina Pandit <Ina dot Pandit at kpitcummins dot com>
- Cc: "gcc-help\ at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 30 Jun 2010 18:00:13 -0700
- Subject: Re: Regression Failures after defining TARGET_VECTOR_MODE_SUPPORTED_P
- References: <F56EA673D3E56E48804FE2B0D23EFD2D2174BFC8F6@KCINPUNHJCMS01.kpit.com>
Ina Pandit <Ina.Pandit@kpitcummins.com> writes:
> We have been implementing GCC port for a new target.
>
> I am getting the following regression failures,
> ============================================================================
> FAIL: gcc.dg/tree-ssa/gen-vect-11a.c scan-tree-dump-times vect "vectorized 1 loops" 1
> FAIL: gcc.dg/tree-ssa/gen-vect-2.c scan-tree-dump-times vect "vectorized 1 loops" 1
> FAIL: gcc.dg/tree-ssa/gen-vect-25.c scan-tree-dump-times vect "vectorized 2 loops" 1
> ============================================================================
>
> For this target, the mode V2HI is supported. Hence the macro 'TARGET_VECTOR_MODE_SUPPORTED_P' has been defined in the following manner,
>
> ===================================================================
> #undef TARGET_VECTOR_MODE_SUPPORTED_P
> #define TARGET_VECTOR_MODE_SUPPORTED_P xxx_vector_mode_supported_p
>
> bool
> xxx_vector_mode_supported_p (enum machine_mode mode)
> {
> return (mode == V2HImode) ;
> }
> ===================================================================
>
> However, it is observed that these test cases pass if this macro is NOT defined.
> Am I missing something? Do I need to define something else?
This means that the loop was not vectorized for some reason. It's
possible that you are simply missing the expected vector operations.
This is not a bug in your compiler. It's a bug in the test case, which
assumes that certain operations (e.g., binary &) are available for the
vector types. The operation is available when gcc is simulating vectors
using generic code, but it need not be available on real hardware. That
is not a bug, it just means that that sort loop will not be vectorized.
This case is assuming that the loop will be vectorized.
Ian