Fix off-by-one error: the next ASCII character is next one

The bit scan function returns the index of the last non-ASCII
character. The next ASCII is the one after this. This means all the
benchmarks were made while reentering the SIMD loop uselessly...

Change-Id: If7de485a63428bfa36d413049d9239ddda1986aa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
bb10
Thiago Macieira 2014-02-19 18:59:24 -08:00 committed by The Qt Project
parent 3a3a7f8842
commit c1d4a634cb
1 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const
// we don't want to load 32 bytes again in this loop if we know there are non-ASCII
// characters still coming
n = _bit_scan_reverse(n);
nextAscii = src + n;
nextAscii = src + n + 1;
return false;
}
@ -115,7 +115,7 @@ static inline bool simdDecodeAscii(ushort *&dst, const uchar *&nextAscii, const
// we don't want to load 16 bytes again in this loop if we know there are non-ASCII
// characters still coming
n = _bit_scan_reverse(n);
nextAscii = src + n;
nextAscii = src + n + 1;
return false;
}