On Mon, Mar 27, 2017 at 1:37 PM, Steffen Klassert <steffen.klass...@secunet.com> wrote: > On Sat, Mar 25, 2017 at 07:41:17PM +0300, Alexey Dobriyan wrote: >> After (no branches): >> >> mov r8d,0x20 >> mov rdx,0xffffffffffffffff >> mov esi,DWORD PTR [rsi+0x2c] >> mov ecx,r8d >> sub cl,BYTE PTR [rdi+0x2a] >> xor esi,DWORD PTR [rbx] >> mov rdi,rdx >> xor eax,eax >> shl rdi,cl >> bswap edi >> >> Signed-off-by: Alexey Dobriyan <adobri...@gmail.com> > > Also applied to ipsec-next, thanks for the patches Alexey!
Speaking of optimizations. 1) All those ntohl() invocations inside hashes are likely unnecessary (hashing is hashing after all). 2) I din't look closely but it can be further optimized by storing 32 - prefixlen (or 128 - prefixlen) but I don't know if you'll accept such horror. :-)