[dpdk-dev] [PATCH] hash: reverse the operand order to crc32 in rte_hash_crc.h

Thomas Monjalon thomas.monjalon at 6wind.com
Tue Feb 25 11:57:51 CET 2014


25/02/2014 11:07, H. Peter Anvin:
> From: "H. Peter Anvin" <hpa at linux.intel.com>
> 
> Checkin
> 
> a132a9cf2bcd440a974b9d3f5c44ba30b2c895a1 hash: use intrinsic
> 
> changed the rte_hash_crc.h from using the crc32 instruction via inline
> assembly to using an intrinsic.  The intrinsic should allow for better
> compiler performance, but the change did not account for the fact that
> the inline assembly being in AT&T syntax used the opposite operand
> order of the intrinsic.
> 
> This turns out to not matter for correctness, because the CRC32
> operation is commutative.  However, it could potentially matter for
> performance, because the loop is more efficient with the moving
> pointer in the source operand and the accumulation in the destination
> operand.
> 
> This was discovered by Jan Beulich when looking at the equivalent code
> in the Linux kernel.
> 
> Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>

It was also reported by Pashupati Kumar <kumarp at brocade.com>.

Acked and applied.
Thanks
-- 
Thomas


More information about the dev mailing list