On Tue, Dec 20, 2016 at 09:30:17PM +0100, Marc Glisse wrote:
> would it make sense to extend it to rotates later?

I wasn't 100% sure if rotates also require 0..prec-1 rotate counts, or
if they accept arbitrary ones.

> Note that you can write (shift @0 SSA_NAME@1) in the pattern instead of a
> separate test.

That is what I tried first, but there is some bug in genmatch.c that
prevents it.  The:
 (for vec (VECTOR_CST CONSTRUCTOR)
  (simplify
   (shiftrotate @0 vec@1)
results in case SSA_NAME: being added to a switch:
    case SSA_NAME:
      if (do_valueize (valueize, op1) != NULL_TREE)
        {
          gimple *def_stmt = SSA_NAME_DEF_STMT (op1);
          if (gassign *def = dyn_cast <gassign *> (def_stmt))
            switch (gimple_assign_rhs_code (def))
              {
              case CONSTRUCTOR:
and the SSA_NAME@1 in another simplification resulted in another
    case SSA_NAME:
into the same switch (rather than appending to the case SSA_NAME).

        Jakub

Reply via email to