@@ -76,33 +76,33 @@ static const char *bc_count_digits(const char *str, const char *end)
76
76
return str ;
77
77
}
78
78
79
- static inline const char * bc_skip_zero_reverse (const char * str , const char * end )
79
+ static inline const char * bc_skip_zero_reverse (const char * scaner , const char * stop )
80
80
{
81
81
/* Check in bulk */
82
82
#ifdef __SSE2__
83
- const __m128i c_zero_repeat = _mm_set1_epi8 (( signed char ) '0' );
84
- while (str - sizeof (__m128i ) >= end ) {
85
- str -= sizeof (__m128i );
86
- __m128i bytes = _mm_loadu_si128 ((const __m128i * ) str );
83
+ const __m128i c_zero_repeat = _mm_set1_epi8 ('0' );
84
+ while (scaner - sizeof (__m128i ) >= stop ) {
85
+ scaner -= sizeof (__m128i );
86
+ __m128i bytes = _mm_loadu_si128 ((const __m128i * ) scaner );
87
87
/* Checks if all numeric strings are equal to '0'. */
88
88
bytes = _mm_cmpeq_epi8 (bytes , c_zero_repeat );
89
89
90
90
int mask = _mm_movemask_epi8 (bytes );
91
91
/* The probability of having 16 trailing 0s in a row is very low, so we use EXPECTED. */
92
92
if (EXPECTED (mask != 0xffff )) {
93
93
/* Move the pointer back and check each character in loop. */
94
- str += sizeof (__m128i );
94
+ scaner += sizeof (__m128i );
95
95
break ;
96
96
}
97
97
}
98
98
#endif
99
99
100
100
/* Exclude trailing zeros. */
101
- while (str - 1 >= end && str [-1 ] == '0' ) {
102
- str -- ;
101
+ while (scaner - 1 >= end && scaner [-1 ] == '0' ) {
102
+ scaner -- ;
103
103
}
104
104
105
- return str ;
105
+ return scaner ;
106
106
}
107
107
108
108
/* Assumes `num` points to NULL, i.e. does yet not hold a number. */
0 commit comments