On 08/02/2015 05:03 AM, Kumar, Venkataramanan wrote:
Hi Jakub,
Thank you for reviewing the patch.
I have incorporated your comments in the attached patch.
Note Jakub is on PTO for the next 3 weeks.
vectorize_mults_via_shift.diff.txt
diff --git a/gcc/testsuite/gcc.dg/vect/vect-mult-patterns.c
b/gcc/testsuite/gcc.dg/vect/vect-mult-patterns.c
Jakub would probably like more testcases :-)
The most obvious thing to test would be other shift factors.
A negative test to verify we don't try to turn a multiply by
non-constant or multiply by a constant that is not a power of 2 into shifts.
[ Would it make sense, for example, to turn a multiply by 3 into a
shift-add sequence? As Jakub said, choose_mult_variant can be your
friend. ]
@@ -2147,6 +2152,140 @@ vect_recog_vector_vector_shift_pattern (vec<gimple>
*stmts,
return pattern_stmt;
}
+/* Detect multiplication by constant which are postive or negatives of power 2,
s/postive/positive/
Jeff