diff mbox

[2/3] Allow divmod on UNITS_PER_WORD vectors

Message ID 1342723978-30066-2-git-send-email-rth@redhat.com
State New
Headers show

Commit Message

Richard Henderson July 19, 2012, 6:52 p.m. UTC
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(-)

Comments

Jakub Jelinek July 19, 2012, 8:28 p.m. UTC | #1
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
diff mbox

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;
     }