Patchwork [2/3] Allow divmod on UNITS_PER_WORD vectors

login
register
mail settings
Submitter Richard Henderson
Date July 19, 2012, 6:52 p.m.
Message ID <1342723978-30066-2-git-send-email-rth@redhat.com>
Download mbox | patch
Permalink /patch/172026/
State New
Headers show

Comments

Richard Henderson - July 19, 2012, 6:52 p.m.
IA64 vectors modes are of course all UNITS_PER_WORD.  I see no reason
to prevent the transformation of a V4HImode divmod, or even of V2SImode.

Jakub, was there another reason you added this condition?


r~



        * tree-vect-patterns.c (vect_recog_divmod_pattern): Do not require
        vectors larger than UNITS_PER_WORD.
---
 gcc/ChangeLog            |    3 +++
 gcc/tree-vect-patterns.c |    3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)
Jakub Jelinek - July 19, 2012, 8:28 p.m.
On Thu, Jul 19, 2012 at 11:52:57AM -0700, Richard Henderson wrote:
> IA64 vectors modes are of course all UNITS_PER_WORD.  I see no reason
> to prevent the transformation of a V4HImode divmod, or even of V2SImode.
> 
> Jakub, was there another reason you added this condition?

I guess I wanted to play on the safe side given that vectorizable_operation
already does something with such mode sizes:

  if (icode == CODE_FOR_nothing)
    {
      if (vect_print_dump_info (REPORT_DETAILS))
        fprintf (vect_dump, "op not supported by target.");
      /* Check only during analysis.  */
      if (GET_MODE_SIZE (vec_mode) != UNITS_PER_WORD
          || (!vec_stmt && vf < vect_min_worthwhile_factor (code)))
        return false;
      if (vect_print_dump_info (REPORT_DETAILS))
        fprintf (vect_dump, "proceeding using word mode.");
    }

and didn't want to convert something that possibly could be already
vectorized somehow, at least without being able to test what it actually
does.

	Jakub

Patch

diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 05202a8..d990c4f 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -1679,8 +1679,7 @@  vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
     {
       enum machine_mode vec_mode = TYPE_MODE (vectype);
       int icode = (int) optab_handler (optab, vec_mode);
-      if (icode != CODE_FOR_nothing
-	  || GET_MODE_SIZE (vec_mode) == UNITS_PER_WORD)
+      if (icode != CODE_FOR_nothing)
 	return NULL;
     }