On 08/07/2014 02:57 AM, Kyrill Tkachov wrote:
> +  if (one_match > zero_match)
> +    {
> +      /* Set either first three quarters or all but the third.        */
> +      mask = 0xffffll << (16 - first_not_ffff_match);
> +      emit_insn (gen_rtx_SET (VOIDmode, dest,
> +                           GEN_INT (val | mask | 0xffffffff00000000ull)));
> +
> +      /* Now insert other two quarters.       */
> +      for (i = first_not_ffff_match + 16, mask <<= (first_not_ffff_match << 
> 1);
> +        i < 64; i += 16, mask <<= 16)
>       {
>         if ((val & mask) != mask)
> +         emit_insn (gen_insv_immdi (dest, GEN_INT (i),
> +                                    GEN_INT ((val >> i) & 0xffff)));
>       }
> +      return;
>      }
>  
>    if (zero_match == 2)

You should not place this three instruction sequence before the two instruction
sequences that follow.  I.e. place this just before simple_sequence.

I do wonder if we should be memo-izing these computations so that we only have
to do the complex search for a sequence only once for each constant...


r~

Reply via email to