https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98849

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org,
                   |                            |rearnsha at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, so on powerpc64le this works fine, expand_binop has:
1558      /* If this is a vector shift by a scalar, see if we can do a vector
1559         shift by a vector.  If so, broadcast the scalar into a vector.  */
1560      if (mclass == MODE_VECTOR_INT)
1561        {
1562          optab otheroptab = unknown_optab;
1563    
1564          if (binoptab == ashl_optab)
1565            otheroptab = vashl_optab;
1566          else if (binoptab == ashr_optab)
1567            otheroptab = vashr_optab;
1568          else if (binoptab == lshr_optab)
1569            otheroptab = vlshr_optab;
1570          else if (binoptab == rotl_optab)
1571            otheroptab = vrotl_optab;
1572          else if (binoptab == rotr_optab)
1573            otheroptab = vrotr_optab;
1574    
1575          if (otheroptab
1576              && (icode = optab_handler (otheroptab, mode)) !=
CODE_FOR_nothing)
1577            {
1578              /* The scalar may have been extended to be too wide. 
Truncate
1579                 it back to the proper size to fit in the broadcast vector.
 */
1580              scalar_mode inner_mode = GET_MODE_INNER (mode);
1581              if (!CONST_INT_P (op1)
1582                  && (GET_MODE_BITSIZE (as_a <scalar_int_mode> (GET_MODE
(op1)))
1583                      > GET_MODE_BITSIZE (inner_mode)))
1584                op1 = force_reg (inner_mode,
1585                                 simplify_gen_unary (TRUNCATE, inner_mode,
op1,
1586                                                     GET_MODE (op1)));
1587              rtx vop1 = expand_vector_broadcast (mode, op1);
1588              if (vop1)
1589                {
1590                  temp = expand_binop_directly (icode, mode, otheroptab,
op0, vop1,
1591                                                target, unsignedp, methods,
last);
1592                  if (temp)
(gdb) 
1593                    return temp;
1594                }
1595            }
1596        }
code for this.  It doesn't work in the ARM case, because it doesn't support
either vec_duplicate_optab nor vec_init_optab for the mode.

I'm declaring this a backend bug, it shouldn't advertise such vector shifts in
configurations in which it can't even init such vectors.

Reply via email to