xdiff: import new 32-bit version of count_masked_bytes()
commit8072766cc6756e9218ea7c9433b097b696329407
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Tue, 22 May 2012 20:36:57 +0000 (22 22:36 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 May 2012 16:10:17 +0000 (23 09:10 -0700)
tree03da9315a3f6759bdd7df50163bc765013aca190
parent7e356a979459092d10450e66d8512381e89c2570
xdiff: import new 32-bit version of count_masked_bytes()

Import the latest 32-bit implementation of count_masked_bytes() from
Linux (arch/x86/include/asm/word-at-a-time.h).  It's shorter and avoids
overflows and negative numbers.

This fixes test failures on 32-bit, where negative partial results had
been shifted right using the "wrong" method (logical shift right instead
of arithmetic short right).  The compiler is free to chose the method,
so it was only wrong in the sense that it didn't work as intended by us.

Reported-by: Øyvind A. Holm <sunny@sunbase.org>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff/xutils.c