On 12/22/2011 12:05 PM, Richard Sandiford wrote: > Probably one of those where you had to stop following the rathole, > but could this be generalised to handle pairs in which perm[1] > == perm[0] + 8? Something like: > >> + if (!(TARGET_HARD_FLOAT && TARGET_LOONGSON_VECTORS)) >> + return false; >> + /* Note that we've already matched V2SI via punpck and V4HI via pshufh. >> */ >> + if (d->vmode != V8QImode) >> + return false; >> + if (d->perm[1] != (d->one_vector_p ? : d->perm[0] : d->perm[0] + 8)) >> + return false; >> + >> + for (i = 2; i < 8; ++i) >> + if (d->perm[i] != d->perm[i & 1]) >> + return false; > > then use both d->op0 and d->op1 in the pack?
Hum. I suppose. But that's starting to look more like the i386 expand_vec_perm_interleave2 + valid_perm_using_mode_p, or something. I'd rather leave this patch alone and do a follow-up if you want. r~