On 08/18/2011 02:23 AM, Richard Guenther wrote: >>> >> The first one (inefficient) is vec0 > vec1 ? {-1,...} : {0,...} >>> >> The second is vec0 > vec1. expand_vec_cond_expr is stupid, which is >>> >> fine, but it means that we need to construct it carefully. >> > >> > This is still important. > Yes. I think the backends need to handle optimizing this case, > esp. considering targets that do not have instructions to produce > a {-1,...}/{0,...} bitmask from a comparison but produce a vector > of condition codes. With using vec0 > vec1 ? {-1...} : {0,...} for > mask = vec0 > vec1; we avoid exposing the result kind of > vector comparisons. > > It should be easily possible for x86 for example to recognize > the -1 : 0 case. >
I think you've been glossing over the hard part with "..." up there. I challenge you to actually fill that in with something meaningful in rtl. I suspect that you simply have to add another named pattern that will Do What You Want on mips and suchlike that produce a CCmode. r~