[aarch64] Improve TImode constant moves

Richard Henderson rth@redhat.com
Mon Jan 25 16:32:00 GMT 2016


On 01/25/2016 01:32 AM, Kyrill Tkachov wrote:
> +    case CONST_WIDE_INT:
> +      *cost = 0;
> +      for (unsigned int n = CONST_WIDE_INT_NUNITS(x), i = 0; i < n; ++i)
> +    {
> +      unsigned HOST_WIDE_INT e = CONST_WIDE_INT_ELT(x, i);
> +      if (e != 0)
> +        *cost += COSTS_N_INSNS (aarch64_internal_mov_immediate
> +                    (NULL_RTX, GEN_INT (e), false, DImode));
> +    }
> +      return true;
> +
> 
> We usually avoid creating intermediate rtxes in the cost function because
> it can potentially be called many times during compilation and we want to avoid
> creating too many short-lived objects, though I suppose there's no way getting
> around this one (the GEN_INT call).

Well, it's only aarch64_internal_mov_immediate -- we could change the interface
to provide the HOST_WIDE_INT value directly.

But that was more than I wanted to do for enabling splittable TImode constants.


r~



More information about the Gcc-patches mailing list