On Thu, Apr 28, 2016 at 01:36:30PM +0300, Ilya Enkovich wrote:
> @@ -3145,11 +3168,25 @@ scalar_chain::compute_convert_gain ()
>                || GET_CODE (src) == IOR
>                || GET_CODE (src) == XOR
>                || GET_CODE (src) == AND)
> -       gain += ix86_cost->add;
> +       {
> +         gain += ix86_cost->add;
> +         if (CONST_INT_P (XEXP (src, 0)))
> +           gain -= scalar_chain::vector_const_cost (XEXP (src, 0));
> +         if (CONST_INT_P (XEXP (src, 1)))
> +           gain -= scalar_chain::vector_const_cost (XEXP (src, 1));
> +       }
>        else if (GET_CODE (src) == COMPARE)
>         {
>           /* Assume comparison cost is the same.  */
>         }
> +      else if (GET_CODE (src) == CONST_INT)
> +       {
> +         if (REG_P (dst))
> +           gain += COSTS_N_INSNS (2);
> +         else if (MEM_P (dst))
> +           gain += 2 * ix86_cost->int_store[2] - ix86_cost->sse_store[1];
> +         gain -= scalar_chain::vector_const_cost (src);
> +       }
>        else
>         gcc_unreachable ();

Where does the 2 come from?  Is it that the STV pass right now supports only
2 * wordsize modes?  Also, I don't think we should treat equally constants
that fit into the 32-bit immediates and constants that don't, the latter,
when movabsq needs to be used, are more costly.

        Jakub

Reply via email to