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

2022-09-06 Thread Jiufu Guo via Gcc-patches
"Kewen.Lin" writes: > Hi! > >> + >> + /* Use paddi for the low 32 bits. */ >> + if (ud2 != 0 && ud1 != 0 && can_use_paddi) >> +emit_move_insn (dest, gen_rtx_PLUS (DImode, dest, >> +GEN_INT ((ud2 << 16) | ud1))); >> + >> + /* Use

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

2022-09-06 Thread Jiufu Guo via Gcc-patches
Segher Boessenkool writes: > Hi! > > On Tue, Sep 06, 2022 at 08:27:56PM +0800, Jiufu Guo wrote: >> + if (can_create_pseudo_p ()) >> +{ >> + /* pli A,H + pli B,L + rldimi A,B,32,0. */ > > A is the low one and B is the high one (the one that needs to be > shifted). rl[wd]imi is one

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

2022-09-06 Thread Kewen.Lin via Gcc-patches
Hi! > + > + /* Use paddi for the low 32 bits. */ > + if (ud2 != 0 && ud1 != 0 && can_use_paddi) > + emit_move_insn (dest, gen_rtx_PLUS (DImode, dest, > + GEN_INT ((ud2 << 16) | ud1))); > + > + /* Use oris, ori for low 32 bits.

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

2022-09-06 Thread Segher Boessenkool
Hi! On Tue, Sep 06, 2022 at 08:27:56PM +0800, Jiufu Guo wrote: > + if (can_create_pseudo_p ()) > + { > + /* pli A,H + pli B,L + rldimi A,B,32,0. */ A is the low one and B is the high one (the one that needs to be shifted). rl[wd]imi is one of our very few insns that has the outpu

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

2022-09-06 Thread Jiufu Guo via Gcc-patches
Hi, Test cases are updated/added, and code is refined as the comments in the review for previous version: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/600768.html As mentioned in PR106550, since pli could support 34bits immediate, we could use less instructions(3insn would be ok) to b