On Mon, Oct 26, 2015 at 10:26 AM, Richard Biener
wrote:
> On Sat, Oct 24, 2015 at 11:15 PM, Marc Glisse wrote:
>> On Fri, 23 Oct 2015, Hurugalawadi, Naveen wrote:
>>
>> + (minus (bit_and:cs @0 (bit_not @1)) (bit_and:s @0 @1))
>>
>> I am not sure why we have :c on one bit_and but not the other.
>
On Sat, Oct 24, 2015 at 11:15 PM, Marc Glisse wrote:
> On Fri, 23 Oct 2015, Hurugalawadi, Naveen wrote:
>
> + (minus (bit_and:cs @0 (bit_not @1)) (bit_and:s @0 @1))
>
> I am not sure why we have :c on one bit_and but not the other.
Clearly an omission.
> + (bit_ior:c (bit_and:c @0 (bit_not @1))
On Fri, 23 Oct 2015, Hurugalawadi, Naveen wrote:
+ (minus (bit_and:cs @0 (bit_not @1)) (bit_and:s @0 @1))
I am not sure why we have :c on one bit_and but not the other.
+ (bit_ior:c (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1))
Here on the other hand, I believe the :c on bit_ior is
On Fri, Oct 23, 2015 at 6:29 AM, Hurugalawadi, Naveen
wrote:
> Hi,
>
>>> So I suggest to modify your patch to do
> Done.
>
> Please find attached the modified patch.
>
> Regression tested successfully on X86_64.
Ok.
Thanks,
Richard.
> Thanks,
> Naveen
Hi,
>> So I suggest to modify your patch to do
Done.
Please find attached the modified patch.
Regression tested successfully on X86_64.
Thanks,
Naveendiff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 1e7fbb4..23c6fa9 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -9692,28 +9692,6
On Wed, Oct 21, 2015 at 8:48 AM, Marc Glisse wrote:
> On Tue, 20 Oct 2015, Richard Biener wrote:
>
>> On Tue, Oct 20, 2015 at 8:46 AM, Hurugalawadi, Naveen
>> wrote:
>>>
>>> Hi,
>>>
> +/* Fold X + (X / CST) * -CST to X % CST. */
> This one is still wrong
>>>
>>> Removed.
>>>
> I don'
On Tue, 20 Oct 2015, Richard Biener wrote:
On Tue, Oct 20, 2015 at 8:46 AM, Hurugalawadi, Naveen
wrote:
Hi,
+/* Fold X + (X / CST) * -CST to X % CST. */
This one is still wrong
Removed.
I don't understand the point of the FLOAT_TYPE_P check.
The check was there in fold-const. So, just h
Hi,
>> use if (wi::bit_and (@2, @1) == 0)
Done.
>> and instead of the 2nd group
>> place a :c on the minus of the one not matching INTEGER_CSTs.
Done.
Just curious to know whether ":c" act as commutative operation in the input as
well as output in this case?
Regression tested without any extra f
On Tue, Oct 20, 2015 at 8:46 AM, Hurugalawadi, Naveen
wrote:
> Hi,
>
>>> +/* Fold X + (X / CST) * -CST to X % CST. */
>>> This one is still wrong
> Removed.
>
>>> I don't understand the point of the FLOAT_TYPE_P check.
> The check was there in fold-const. So, just had the same check.
>
>>> Will w
Hi,
>> +/* Fold X + (X / CST) * -CST to X % CST. */
>> This one is still wrong
Removed.
>> I don't understand the point of the FLOAT_TYPE_P check.
The check was there in fold-const. So, just had the same check.
>> Will we also simplify (A & B) - (A & ~B) into B - (A ^ B) ?
Done.
>> or maybe in
On Mon, Oct 19, 2015 at 1:14 PM, Hurugalawadi, Naveen
wrote:
> Hi,
>
>>> That's not what Richard meant. We already have:
>
> Done. As per the comments.
>
> Please find attached the modified patch as per your comments.
>
> Please review them and let me know if any further modifications are required
+/* Fold X + (X / CST) * -CST to X % CST. */
This one is still wrong. It is extremely similar to X-(X/CST)*CST, and the
current version of that one in match.pd is broken, we should fix that one
first.
+/* Fold (A & ~B) - (A & B) into (A ^ B) - B. */
+(simplify
+ (minus (bit_and:s @0 (bit_no
Hi,
Please find attached the modified patch of duplicate patterns which were
posted in the earlier part.
Please review them and let me know if any further modifications are required.
Thanks,
Naveendiff --git a/gcc/fold-const.c b/gcc/fold-const.c
index de45a2c..b36e2f5 100644
--- a/gcc/fold-const
Hi,
>> That's not what Richard meant. We already have:
Done. As per the comments.
Please find attached the modified patch as per your comments.
Please review them and let me know if any further modifications are required.
Thanks,
Naveendiff --git a/gcc/fold-const.c b/gcc/fold-const.c
index de4
+(match (logical_inverted_value @0)
+ (truth_not @0))
That's good.
+/* Simplify ~X & X as zero. */
+(simplify
+ (bit_and:c (convert? truth_valued_p@0) (convert? (logical_inverted_value @0)))
+ { build_zero_cst (type); })
That's not what Richard meant. We already have:
/* X & !X -> 0. */
(s
Hi,
Thanks very much for your detailed explanation regarding the queries.
>> you are missing the convert? on the lshift now, without it the
>> tree_nop_conversion_p check always evaluates to true.
Done.
>> fold-const.c which handles TRUTH_NOT_EXPR but logical_inverted_value
>> does not handle it
On Thu, Oct 15, 2015 at 8:11 AM, Hurugalawadi, Naveen
wrote:
> Hi,
>
> Thanks for all the suggestions.
> Please find attached the modified patch as per your suggestions.
>
> I had missed a mail as pointed by Marc Glisse. Now I have implemented
> everything suggested.
> Please review the patch and
Hi,
Thanks for all the suggestions.
Please find attached the modified patch as per your suggestions.
I had missed a mail as pointed by Marc Glisse. Now I have implemented
everything suggested.
Please review the patch and let me know if any further modifications are
required.
I have some queries
On Wed, 14 Oct 2015, Richard Biener wrote:
On Wed, Oct 14, 2015 at 12:45 PM, Marc Glisse wrote:
On Wed, 14 Oct 2015, Richard Biener wrote:
+/* Fold (a * (1 << b)) into (a << b) */
+(simplify
+ (mult:c @0 (convert? (lshift integer_onep@1 @2)))
+ (if (! FLOAT_TYPE_P (type)
+&& tree_n
On Wed, Oct 14, 2015 at 12:45 PM, Marc Glisse wrote:
> On Wed, 14 Oct 2015, Richard Biener wrote:
>
>>> +/* Fold (a * (1 << b)) into (a << b) */
>>> +(simplify
>>> + (mult:c @0 (convert? (lshift integer_onep@1 @2)))
>>> + (if (! FLOAT_TYPE_P (type)
>>> +&& tree_nop_conversion_p (type, TR
On Wed, 14 Oct 2015, Richard Biener wrote:
+/* Fold (a * (1 << b)) into (a << b) */
+(simplify
+ (mult:c @0 (convert? (lshift integer_onep@1 @2)))
+ (if (! FLOAT_TYPE_P (type)
+&& tree_nop_conversion_p (type, TREE_TYPE (@2)))
+ (lshift @0 (convert @2
You don't need/want to conve
On Wed, Oct 14, 2015 at 7:39 AM, Marc Glisse wrote:
>
> +(simplify
> + (plus (convert? @0) (convert? (xdivamulminusa @0 @1)))
> + (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
> + && tree_nop_conversion_p (type, TREE_TYPE (@0)))
> + (trunc_mod (convert @0) (convert @1
+(simplify
+ (plus (convert? @0) (convert? (xdivamulminusa @0 @1)))
+ (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
+ && tree_nop_conversion_p (type, TREE_TYPE (@0)))
+ (trunc_mod (convert @0) (convert @1
See PR 67953.
+(match (abitandnotb @0 @1)
+ (bit_and:c @0 (bi
Hi.
>> please adjust also according to these comments.
Adjusted the patch as per your comments.
Please find attached the patch as per your comments.
Please review the patch and let me know if any further modifications
are required.
Thanks,
Naveendiff --git a/gcc/fold-const.c b/gcc/fold-const.c
On Tue, Oct 13, 2015 at 2:18 PM, Marc Glisse wrote:
> On Tue, 13 Oct 2015, Richard Biener wrote:
>
>> +/* Simplify ~X & X as zero. */
>> +(simplify
>> + (bit_and:c (convert? @0) (convert? (bit_not @0)))
>> + (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
>
>
> The test seems unnecessary for
On Tue, 13 Oct 2015, Richard Biener wrote:
+/* Simplify ~X & X as zero. */
+(simplify
+ (bit_and:c (convert? @0) (convert? (bit_not @0)))
+ (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
The test seems unnecessary for this specific transformation.
+ { build_zero_cst (TREE_TYPE (@0));
On Tue, Oct 13, 2015 at 12:52 PM, Hurugalawadi, Naveen
wrote:
> Hi Richard,
>
> Thanks for the comments. Sorry, I was confused with handling the const and
> variable
> together part. Have modified them.
> Also, considered that both (X & Y) can be const or variable in those cases
> for which match
On Tue, 13 Oct 2015, Hurugalawadi, Naveen wrote:
Please find attached the patch as per your comments.
(hmm, maybe you missed the email I sent with other comments?)
+(simplify
+ (plus (convert? @0) (convert? (xdivamulminusa @0 @1)))
+ (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (typ
Hi Richard,
Thanks for the comments. Sorry, I was confused with handling the const and
variable
together part. Have modified them.
Also, considered that both (X & Y) can be const or variable in those cases
for which match patterns have been added.
Please let me know whether its correct or only "
On Mon, Oct 12, 2015 at 12:22 PM, Hurugalawadi, Naveen
wrote:
> Hi Richard,
>
> Thanks for your review and useful comments.
> I will move the future optimization patterns with all the conditions
> present in fold-const or builtins file as per your suggestions.
>
> Please find attached the patch a
On Mon, 12 Oct 2015, Hurugalawadi, Naveen wrote:
+/* Fold X + (X / CST) * -CST to X % CST. */
+(simplify
+ (plus (convert1? @0) (convert2? (mult (trunc_div @0 INTEGER_CST@1)
INTEGER_CST@2)))
+ (if ((INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type))
+ && wi::add (@1, @2) == 0)
+ (
Hi Richard,
Thanks for your review and useful comments.
I will move the future optimization patterns with all the conditions
present in fold-const or builtins file as per your suggestions.
Please find attached the patch as per your comments.
Please review the patch and let me know if any further
On Thu, Oct 8, 2015 at 8:15 PM, Bernd Schmidt wrote:
> On 10/08/2015 08:03 PM, Joseph Myers wrote:
>>
>> On Thu, 8 Oct 2015, Bernd Schmidt wrote:
>>
>>> On 10/07/2015 11:54 AM, Hurugalawadi, Naveen wrote:
Move Fold X & (X ^ Y) as X & ~Y to match.pd.
Move Fold X & (Y
On 10/08/2015 08:03 PM, Joseph Myers wrote:
On Thu, 8 Oct 2015, Bernd Schmidt wrote:
On 10/07/2015 11:54 AM, Hurugalawadi, Naveen wrote:
Move Fold X & (X ^ Y) as X & ~Y to match.pd.
Move Fold X & (Y ^ X) as ~Y & X to match.pd.
I wonder if we shouldn't try to autogenerate patt
On Thu, 8 Oct 2015, Bernd Schmidt wrote:
> On 10/07/2015 11:54 AM, Hurugalawadi, Naveen wrote:
> > Move Fold X & (X ^ Y) as X & ~Y to match.pd.
> > Move Fold X & (Y ^ X) as ~Y & X to match.pd.
>
> I wonder if we shouldn't try to autogenerate patterns such as these. I did
> something like
On 10/07/2015 11:54 AM, Hurugalawadi, Naveen wrote:
Move Fold X & (X ^ Y) as X & ~Y to match.pd.
Move Fold X & (Y ^ X) as ~Y & X to match.pd.
I wonder if we shouldn't try to autogenerate patterns such as these. I
did something like that for a different project a long time ago.
On Wed, Oct 7, 2015 at 11:54 AM, Hurugalawadi, Naveen
wrote:
> Hi,
>
> Please find attached the patch that moves some more patterns from
> fold-const using simplify and match.
>
> Please review the patch and let me know if any modifications are required.
+/* Fold X + (X / CST) * -CST to X % CST.
37 matches
Mail list logo