Re: [PATCH] powerpc: optimise WARN_ON()

2019-08-19 Thread Segher Boessenkool
On Mon, Aug 19, 2019 at 07:40:42AM +0200, Christophe Leroy wrote: > Le 18/08/2019 à 14:01, Segher Boessenkool a écrit : > >On Sat, Aug 17, 2019 at 09:04:42AM +, Christophe Leroy wrote: > >>Unlike BUG_ON(x), WARN_ON(x) uses !!(x) as the trigger > >>of the t(d/w)nei instruction instead of using d

Re: [PATCH] powerpc: optimise WARN_ON()

2019-08-18 Thread Christophe Leroy
Le 18/08/2019 à 14:01, Segher Boessenkool a écrit : On Sat, Aug 17, 2019 at 09:04:42AM +, Christophe Leroy wrote: Unlike BUG_ON(x), WARN_ON(x) uses !!(x) as the trigger of the t(d/w)nei instruction instead of using directly the value of x. This leads to GCC adding unnecessary pair of add

Re: [PATCH] powerpc: optimise WARN_ON()

2019-08-18 Thread Segher Boessenkool
On Sat, Aug 17, 2019 at 09:04:42AM +, Christophe Leroy wrote: > Unlike BUG_ON(x), WARN_ON(x) uses !!(x) as the trigger > of the t(d/w)nei instruction instead of using directly the > value of x. > > This leads to GCC adding unnecessary pair of addic/subfe. And it has to, it is passed as an "r"

[PATCH] powerpc: optimise WARN_ON()

2019-08-17 Thread Christophe Leroy
Unlike BUG_ON(x), WARN_ON(x) uses !!(x) as the trigger of the t(d/w)nei instruction instead of using directly the value of x. This leads to GCC adding unnecessary pair of addic/subfe. This was revealed after adding a WARN_ON() on top of clear_page() in order to detect misaligned destination: @@ -