Re: [PATCH] xfrm: branchless addr4_match() on 64-bit

2017-03-25 Thread Alexey Dobriyan
On Fri, Mar 24, 2017 at 05:16:44PM +, David Laight wrote: > From: Alexey Dobriyan > > Sent: 23 March 2017 23:33 > > Current addr4_match() code has special test for /0 prefixes because of > > standard required undefined behaviour. However, it is possible to omit > > it on 64-bit because

RE: [PATCH] xfrm: branchless addr4_match() on 64-bit

2017-03-24 Thread David Laight
From: Alexey Dobriyan > Sent: 23 March 2017 23:33 > Current addr4_match() code has special test for /0 prefixes because of > standard required undefined behaviour. However, it is possible to omit > it on 64-bit because shifting can be done in a 64-bit register and then > truncated to the expected

[PATCH] xfrm: branchless addr4_match() on 64-bit

2017-03-23 Thread Alexey Dobriyan
Current addr4_match() code has special test for /0 prefixes because of standard required undefined behaviour. However, it is possible to omit it on 64-bit because shifting can be done in a 64-bit register and then truncated to the expected value (which is 0 mask). Implicit truncation by htonl()