[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-10-20 Thread guojiufu at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 Jiu Fu Guo changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-10-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #15 from CVS Commits --- The master branch has been updated by Jiu Fu Guo : https://gcc.gnu.org/g:222f312a773157f53396ba4cb287deb07f84cc34 commit r11-4033-g222f312a773157f53396ba4cb287deb07f84cc34 Author: guojiufu Date: Mon Oct

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-13 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #13 from Li Jia He --- In this optimization we assume n is either positive or divisible by the nth power of 2. So the result of the % is non-negative. However, it is not reasonable for translating (a % 32)) to (a & 31). If a is

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #12 from Segher Boessenkool --- Sure, but what makes shift amount special here? This works just fine in any other expression as well. That is, for unsigned n; for negative numbers modulo works differently: it returns 0 or negative,

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #11 from Li Jia He --- The reason is that it is the remainder of the nth power of 2. In x >> (n% 32), 32 is the fifth power of 2. The hexadecimal representation of 32 is 0x100. Taking the remainder of 0x100, the data range is 0 ~

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #10 from Segher Boessenkool --- What makes shift amount special at all, for those gimple simplifications?

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #9 from Li Jia He --- (In reply to Andrew Pinski from comment #8) > (In reply to Andrew Pinski from comment #7) > > (In reply to Andrew Pinski from comment #6) > > > (In reply to Li Jia He from comment #5) > > > > Could we consider

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #8 from Andrew Pinski --- (In reply to Andrew Pinski from comment #7) > (In reply to Andrew Pinski from comment #6) > > (In reply to Li Jia He from comment #5) > > > Could we consider doing this optimization on gimple? I use the

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #7 from Andrew Pinski --- (In reply to Andrew Pinski from comment #6) > (In reply to Li Jia He from comment #5) > > Could we consider doing this optimization on gimple? I use the following > > code on gimple to produce optimized

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #6 from Andrew Pinski --- (In reply to Li Jia He from comment #5) > Could we consider doing this optimization on gimple? I use the following > code on gimple to produce optimized results on powerpc64. It might make sense. But

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2020-02-10 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 Li Jia He changed: What|Removed |Added CC||helijia at gcc dot gnu.org --- Comment #5

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2017-11-20 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #4 from Segher Boessenkool --- Trunk does (both -m32 and -m64) srawi 9,4,5 addze 9,9 slwi 9,9,5 subf 4,9,4 srw 3,3,4 and rlwinm 4,4,0,27,31 srw 3,3,4 so the original problem

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2015-06-30 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 --- Comment #3 from Martin Sebor msebor at gcc dot gnu.org --- (In reply to Segher Boessenkool from comment #2) I opened bug 66706.

[Bug rtl-optimization/66552] Missed optimization when shift amount is result of signed modulus

2015-06-29 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66552 Segher Boessenkool segher at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW