Re: [PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-14 Thread Segher Boessenkool
Hi Christophe, On Tue, Aug 13, 2019 at 09:59:35AM +, Christophe Leroy wrote: > + rldicr \r, \r, 32, 31 Could you please write this as sldi\r, \r, 32 ? It's much easier to read, imo (it's the exact same instruction). You can do a lot cheaper sequences if you

Re: [PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-14 Thread Christophe Leroy
Le 14/08/2019 à 04:08, Paul Mackerras a écrit : On Tue, Aug 13, 2019 at 09:59:35AM +, Christophe Leroy wrote: [snip] +.macro __LOAD_REG_IMMEDIATE r, x + .if \x & ~0x != 0 + __LOAD_REG_IMMEDIATE_32 \r, (\x) >> 32 + rldicr \r, \r, 32, 31 +

Re: [PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-13 Thread Paul Mackerras
On Tue, Aug 13, 2019 at 09:59:35AM +, Christophe Leroy wrote: [snip] > +.macro __LOAD_REG_IMMEDIATE r, x > + .if \x & ~0x != 0 > + __LOAD_REG_IMMEDIATE_32 \r, (\x) >> 32 > + rldicr \r, \r, 32, 31 > + .if (\x) & 0x != 0 > +

[PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-13 Thread Christophe Leroy
Today LOAD_REG_IMMEDIATE() is a basic #define which loads all parts on a value into a register, including the parts that are NUL. This means always 2 instructions on PPC32 and always 5 instructions on PPC64. And those instructions cannot run in parallele as they are updating the same register. Ex