This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Move targetm.units_per_simd_word to largest_simd_mode
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, richard dot earnshaw at arm dot com, rth at redhat dot com, rdsandiford at googlemail dot com, edelsohn at gnu dot org
- Date: Tue, 5 Oct 2010 20:30:32 +0200
- Subject: Re: [PATCH] Move targetm.units_per_simd_word to largest_simd_mode
- References: <alpine.LNX.2.00.1010051747540.8982@zhemvz.fhfr.qr>
> Index: trunk/gcc/config/sparc/sparc.c
> ===================================================================
> *** trunk.orig/gcc/config/sparc/sparc.c 2010-10-05 17:42:07.000000000 +0200
> --- trunk/gcc/config/sparc/sparc.c 2010-10-05 17:53:48.000000000 +0200
> *************** static bool sparc_can_eliminate (const i
> *** 435,441 ****
> static const char *sparc_mangle_type (const_tree);
> #endif
> static void sparc_trampoline_init (rtx, tree, rtx);
> ! static unsigned int sparc_units_per_simd_word (enum machine_mode);
>
> #ifdef SUBTARGET_ATTRIBUTE_TABLE
> /* Table of valid machine attributes. */
> --- 435,441 ----
> static const char *sparc_mangle_type (const_tree);
> #endif
> static void sparc_trampoline_init (rtx, tree, rtx);
> ! static unsigned int sparc_largest_simd_mode (enum machine_mode);
>
> #ifdef SUBTARGET_ATTRIBUTE_TABLE
> /* Table of valid machine attributes. */
enum machine_mode
> *************** sparc_vector_mode_supported_p (enum mach
> *** 6244,6255 ****
> return TARGET_VIS && VECTOR_MODE_P (mode) ? true : false;
> }
>
> ! /* Implement the TARGET_VECTORIZE_UNITS_PER_SIMD_WORD target hook. */
>
> ! static unsigned int
> ! sparc_units_per_simd_word (enum machine_mode mode ATTRIBUTE_UNUSED)
> {
> ! return TARGET_VIS ? 8 : UNITS_PER_WORD;
> }
>
> /* Return the string to output an unconditional branch to LABEL, which is
> --- 6244,6270 ----
> return TARGET_VIS && VECTOR_MODE_P (mode) ? true : false;
> }
>
> ! /* Implement the TARGET_VECTORIZE_LARGEST_SIMD_MODE target hook. */
>
> ! static enum machine_mode
> ! sparc_largest_simd_mode (enum machine_mode mode)
> {
> ! if (TARGET_VIS)
> ! switch (mode)
> ! {
> ! case SFmode:
> ! return V2SFmode;
> ! case SImode:
> ! return V2SImode;
> ! case HImode:
> ! return V4HImode;
> ! case QImode:
> ! return V8QImode;
> !
> ! default:;
> ! }
> !
> ! return word_mode;
> }
>
> /* Return the string to output an unconditional branch to LABEL, which is
SPARC doesn't support floating-point vector modes. sparc-modes.def reads:
/* Vector modes. */
VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */
VECTOR_MODES (INT, 4); /* V4QI V2HI */
--
Eric Botcazou