Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-26 Thread Jiufu Guo via Gcc-patches
Hi, Segher Boessenkool writes: > Hi! > > On Thu, Aug 25, 2022 at 08:11:31PM +0800, Jiufu Guo wrote: >> Segher Boessenkool writes: >> > You usually can split fine if you cannot create new pseudos, by reusing >> > existing registers. >> > >> > FAIL will cause an ICE: the RTL instruction does matc

Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-25 Thread Segher Boessenkool
Hi! On Thu, Aug 25, 2022 at 08:11:31PM +0800, Jiufu Guo wrote: > Segher Boessenkool writes: > > You usually can split fine if you cannot create new pseudos, by reusing > > existing registers. > > > > FAIL will cause an ICE: the RTL instruction does match, but will fail > > when trying to generate

Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-25 Thread Jiufu Guo via Gcc-patches
Hi, Segher Boessenkool writes: > On Wed, Aug 24, 2022 at 03:48:49PM +0800, Jiufu Guo wrote: >> Segher Boessenkool writes: >> >> + "TARGET_POWERPC64 && !reload_completed && can_create_pseudo_p () >> > >> > reload_completed in splitters is almost always wrong. It isn't any >> > better if it is

Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-24 Thread Segher Boessenkool
On Wed, Aug 24, 2022 at 03:48:49PM +0800, Jiufu Guo wrote: > Segher Boessenkool writes: > >> + "TARGET_POWERPC64 && !reload_completed && can_create_pseudo_p () > > > > reload_completed in splitters is almost always wrong. It isn't any > > better if it is in the insn condition of a define_insn_an

Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-24 Thread Jiufu Guo via Gcc-patches
Hi! Segher Boessenkool writes: > Hi! > > On Mon, Jul 25, 2022 at 09:29:22PM +0800, Jiufu Guo wrote: >> When checking eq/neq with a constant which has only 16bits, it can be >> optimized to check the rotated data. By this, the constant building >> is optimized. > > "ne", not "neq". Oh, thanks! >

Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-23 Thread Segher Boessenkool
Hi! On Mon, Jul 25, 2022 at 09:29:22PM +0800, Jiufu Guo wrote: > When checking eq/neq with a constant which has only 16bits, it can be > optimized to check the rotated data. By this, the constant building > is optimized. "ne", not "neq". > gcc/ChangeLog: > > * config/rs6000/rs6000-protos

Re: [PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-08-16 Thread Jiufu Guo via Gcc-patches
Gentle ping: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598769.html BR, Jeff(Jiufu) Jiufu Guo writes: > Hi, > > When checking eq/neq with a constant which has only 16bits, it can be > optimized to check the rotated data. By this, the constant building > is optimized. > > As the exam

[PATCH V4] rs6000: Optimize cmp on rotated 16bits constant

2022-07-25 Thread Jiufu Guo via Gcc-patches
Hi, When checking eq/neq with a constant which has only 16bits, it can be optimized to check the rotated data. By this, the constant building is optimized. As the example in PR103743: For "in == 0x8000LL", this patch generates: rotldi %r3,%r3,16 cmpldi %cr0,%r3,32768