RE: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread David Laight
From: naveen.n@linux.vnet.ibm.com > Sent: 09 October 2017 15:48 ... > This is about the behavior of the gcc builtin being undefined, rather > than the actual cpu instruction itself. I'd have hoped that the ggc builtin just generated the expected cpu instruction. So is only undefined because

Re: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread Segher Boessenkool
On Mon, Oct 09, 2017 at 01:49:26PM +, David Laight wrote: > From: Sandipan Das > > Sent: 09 October 2017 12:07 > > According to the GCC documentation, the behaviour of __builtin_clz() > > and __builtin_clzl() is undefined if the value of the input argument > > is zero. Without handling this

Re: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread Segher Boessenkool
On Mon, Oct 09, 2017 at 02:43:45PM +, David Laight wrote: > From: Segher Boessenkool > > Sent: 09 October 2017 15:21 > > On Mon, Oct 09, 2017 at 01:49:26PM +, David Laight wrote: > > > From: Sandipan Das > > > > Sent: 09 October 2017 12:07 > > > > According to the GCC documentation, the

Re: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread naveen.n....@linux.vnet.ibm.com
On 2017/10/09 02:43PM, David Laight wrote: > From: Segher Boessenkool > > Sent: 09 October 2017 15:21 > > On Mon, Oct 09, 2017 at 01:49:26PM +, David Laight wrote: > > > From: Sandipan Das > > > > Sent: 09 October 2017 12:07 > > > > According to the GCC documentation, the behaviour of

Re: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread Naveen N. Rao
On 2017/10/09 11:07AM, Sandipan Das wrote: > According to the GCC documentation, the behaviour of __builtin_clz() > and __builtin_clzl() is undefined if the value of the input argument > is zero. Without handling this special case, these builtins have been > used for emulating the following

RE: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread David Laight
From: Segher Boessenkool > Sent: 09 October 2017 15:21 > On Mon, Oct 09, 2017 at 01:49:26PM +, David Laight wrote: > > From: Sandipan Das > > > Sent: 09 October 2017 12:07 > > > According to the GCC documentation, the behaviour of __builtin_clz() > > > and __builtin_clzl() is undefined if the

RE: [PATCH] powerpc/lib/sstep: Fix count leading zeros instructions

2017-10-09 Thread David Laight
From: Sandipan Das > Sent: 09 October 2017 12:07 > According to the GCC documentation, the behaviour of __builtin_clz() > and __builtin_clzl() is undefined if the value of the input argument > is zero. Without handling this special case, these builtins have been > used for emulating the following