On Fri, Oct 28, 2011 at 10:22:15AM +0200, Richard Guenther wrote: > Hm, but you are testing vector modes in the path that is supposed to > handle shifts by a scalar. That looks odd. Also it should be easy
No, I'm testing it in the path that is supposed to handle shifts by a vector. That block starts with: /* Vector shifted by vector. */ if (!scalar_shift_arg) { Which means I'd have to duplicate there big parts of vectorizable_type_promotion and vectorizable_type_demotion and handle all these widening resp. narrowing cases. I know you don't like tree-vect-pattern.c too much, but IMHO just changing the shifts in there to have rhs2 type matching rhs1 type would be far easier and more maintainable. Especially when it can handle additionally what one of the testcases does - long long shift with long long shift count, which should be naturally vectorized without any promotion/demotion, but the FEs insert there a cast to (int) which would result in the promotion/demotion. Jakub