On Thu, Nov 5, 2015 at 2:26 PM, Alan Lawrence wrote:
> On 3 November 2015 at 11:35, Richard Biener
> wrote:
>>
>> I think this should simply re-write A << B to (type) (unsigned-type) A
>> * (1U << B).
>>
>> Does that then still vectorize the signed case?
>
> I didn't realize our representation o
On 3 November 2015 at 11:35, Richard Biener wrote:
>
> I think this should simply re-write A << B to (type) (unsigned-type) A
> * (1U << B).
>
> Does that then still vectorize the signed case?
I didn't realize our representation of chrec's could express that.
Yes, it does - thanks! (And the avx51
On Tue, Nov 3, 2015 at 11:15 AM, Alan Lawrence wrote:
> On 27/10/15 22:27, H.J. Lu wrote:
>>
>> It caused:
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68112
>
> Bah :(.
>
> So yes, in general case, we can't rewrite (a << 1) to (a * 2) as for signed
> types (0x7f...f) << 1 == -2 whereas (0x7
On 27/10/15 22:27, H.J. Lu wrote:
>
> It caused:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68112
Bah :(.
So yes, in general case, we can't rewrite (a << 1) to (a * 2) as for signed
types (0x7f...f) << 1 == -2 whereas (0x7f...f * 2) is undefined behaviour.
Oh well :(...
I don't have a real
On Tue, Oct 27, 2015 at 5:40 AM, Alan Lawrence wrote:
> --in-reply-to
>
>
> On 26/10/15 08:58, Richard Biener wrote:
>>
>> On Fri, Oct 23, 2015 at 5:15 PM, Alan Lawrence wrote:
>>> + chrec2 = fold_build2 (LSHIFT_EXPR, TREE_TYPE (rhs1),
>>> + build_int_cst (TREE_TY
--in-reply-to
On 26/10/15 08:58, Richard Biener wrote:
>
> On Fri, Oct 23, 2015 at 5:15 PM, Alan Lawrence wrote:
>> + chrec2 = fold_build2 (LSHIFT_EXPR, TREE_TYPE (rhs1),
>> + build_int_cst (TREE_TYPE (rhs1), 1),
>
> 'type' instead of TREE_TYPE (rhs1)
I presume y
On Fri, Oct 23, 2015 at 5:15 PM, Alan Lawrence wrote:
> On 19/10/15 12:49, Richard Biener wrote:
>
>> Err, you should always do the shift in the type of rhs1. You should also
>> avoid the chrec_convert of rhs2 above for shifts.
>
> Err, yes, indeed. Needed to keep the chrec_convert before the
>
On 19/10/15 12:49, Richard Biener wrote:
> Err, you should always do the shift in the type of rhs1. You should also
> avoid the chrec_convert of rhs2 above for shifts.
Err, yes, indeed. Needed to keep the chrec_convert before the
chrec_fold_multiply, and the rest followed. How's this?
Bootstr
On Fri, Oct 16, 2015 at 5:25 PM, Alan Lawrence wrote:
> This lets the vectorizer handle some simple strides expressed using left-shift
> rather than mul, e.g. a[i << 1] (whereas previously only a[i * 2] would have
> been handled).
>
> This patch does *not* handle the general case of shifts - neith