Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-06 Thread Jiufu Guo via Gcc-patches
Segher Boessenkool writes: > On Mon, Sep 05, 2022 at 02:25:29PM +0800, Jiufu Guo wrote: >> > On Fri, Sep 02, 2022 at 02:56:21PM +0800, Jiufu Guo wrote: >> > Or force the testcase to use r0 some other way. Well, "forcing" cannot >> > be done, but we can probably encourage it (via a local register

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-05 Thread Segher Boessenkool
On Mon, Sep 05, 2022 at 02:25:29PM +0800, Jiufu Guo wrote: > > On Fri, Sep 02, 2022 at 02:56:21PM +0800, Jiufu Guo wrote: > > Or force the testcase to use r0 some other way. Well, "forcing" cannot > > be done, but we can probably encourage it (via a local register asm for > > example, or by tying

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-04 Thread Jiufu Guo via Gcc-patches
Hi, Segher Boessenkool writes: > Hi! > > On Fri, Sep 02, 2022 at 02:56:21PM +0800, Jiufu Guo wrote: >> >> + /* pli 9,high32 + sldi 9,32 + paddi 9,9,low32. */ >> >> + else >> >> + { >> > >> > The comment goes here, in the block it refers to. Comments for a block >> > are the first thi

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-04 Thread Jiufu Guo via Gcc-patches
"Kewen.Lin" writes: > Hi Jeff, > > Thanks for the patch, some comments on nits are inline. > > on 2022/9/1 11:24, Jiufu Guo wrote: >> Hi, >> >> As mentioned in PR106550, since pli could support 34bits immediate, we could >> use less instructions(3insn would be ok) to build 64bits constant with p

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-02 Thread Segher Boessenkool
On Fri, Sep 02, 2022 at 10:29:35AM -0500, Peter Bergner wrote: > On 9/1/22 4:52 PM, Segher Boessenkool wrote: > > On Thu, Sep 01, 2022 at 11:24:00AM +0800, Jiufu Guo wrote: > >> As mentioned in PR106550, since pli could support 34bits immediate, we > >> could > >> use less instructions(3insn would

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-02 Thread Segher Boessenkool
Hi! On Fri, Sep 02, 2022 at 02:56:21PM +0800, Jiufu Guo wrote: > >> + /* pli 9,high32 + sldi 9,32 + paddi 9,9,low32. */ > >> + else > >> + { > > > > The comment goes here, in the block it refers to. Comments for a block > > are the first thing *in* the block. > OK, great! I like the f

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-02 Thread Peter Bergner via Gcc-patches
On 9/1/22 4:52 PM, Segher Boessenkool wrote: > On Thu, Sep 01, 2022 at 11:24:00AM +0800, Jiufu Guo wrote: >> As mentioned in PR106550, since pli could support 34bits immediate, we could >> use less instructions(3insn would be ok) to build 64bits constant with pli. > >> For example, for constant 0x

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-01 Thread Jiufu Guo via Gcc-patches
Hi, Segher Boessenkool writes: > Hi! > > This patch is a clear improvement :-) > > On Thu, Sep 01, 2022 at 11:24:00AM +0800, Jiufu Guo wrote: >> As mentioned in PR106550, since pli could support 34bits immediate, we could >> use less instructions(3insn would be ok) to build 64bits constant wit

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-01 Thread Kewen.Lin via Gcc-patches
Hi Jeff, Thanks for the patch, some comments on nits are inline. on 2022/9/1 11:24, Jiufu Guo wrote: > Hi, > > As mentioned in PR106550, since pli could support 34bits immediate, we could > use less instructions(3insn would be ok) to build 64bits constant with pli. > > For example, for constant

Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-09-01 Thread Segher Boessenkool
Hi! This patch is a clear improvement :-) On Thu, Sep 01, 2022 at 11:24:00AM +0800, Jiufu Guo wrote: > As mentioned in PR106550, since pli could support 34bits immediate, we could > use less instructions(3insn would be ok) to build 64bits constant with pli. > For example, for constant 0x02080500

[PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants

2022-08-31 Thread Jiufu Guo via Gcc-patches
Hi, As mentioned in PR106550, since pli could support 34bits immediate, we could use less instructions(3insn would be ok) to build 64bits constant with pli. For example, for constant 0x020805006106003, we could generate it with: asm code1: pli 9,101736451 (0x6106003) sldi 9,9,32 paddi 9,9, 213000