@@ -41,7 +41,7 @@ static inline void avx_check_smaller_than_0xF4(__m256i current_bytes,
4141 __m256i *has_error) {
4242 // unsigned, saturates to 0 below max
4343 *has_error = _mm256_or_si256 (
44- *has_error, _mm256_subs_epu8 (current_bytes, _mm256_set1_epi8 (0xF4 )));
44+ *has_error, _mm256_subs_epu8 (current_bytes, _mm256_set1_epi8 (0xF4u )));
4545}
4646
4747static inline __m256i avx_continuation_lengths (__m256i high_nibbles) {
@@ -94,14 +94,14 @@ static inline void avx_check_first_continuation_max(__m256i current_bytes,
9494 __m256i off1_current_bytes,
9595 __m256i *has_error) {
9696 __m256i maskED =
97- _mm256_cmpeq_epi8 (off1_current_bytes, _mm256_set1_epi8 (0xED ));
97+ _mm256_cmpeq_epi8 (off1_current_bytes, _mm256_set1_epi8 (0xEDu ));
9898 __m256i maskF4 =
99- _mm256_cmpeq_epi8 (off1_current_bytes, _mm256_set1_epi8 (0xF4 ));
99+ _mm256_cmpeq_epi8 (off1_current_bytes, _mm256_set1_epi8 (0xF4u ));
100100
101101 __m256i badfollowED = _mm256_and_si256 (
102- _mm256_cmpgt_epi8 (current_bytes, _mm256_set1_epi8 (0x9F )), maskED);
102+ _mm256_cmpgt_epi8 (current_bytes, _mm256_set1_epi8 (0x9Fu )), maskED);
103103 __m256i badfollowF4 = _mm256_and_si256 (
104- _mm256_cmpgt_epi8 (current_bytes, _mm256_set1_epi8 (0x8F )), maskF4);
104+ _mm256_cmpgt_epi8 (current_bytes, _mm256_set1_epi8 (0x8Fu )), maskF4);
105105
106106 *has_error =
107107 _mm256_or_si256 (*has_error, _mm256_or_si256 (badfollowED, badfollowF4));
@@ -119,31 +119,31 @@ static inline void avx_check_overlong(__m256i current_bytes,
119119 __m256i *has_error) {
120120 __m256i off1_hibits = push_last_byte_of_a_to_b (previous_hibits, hibits);
121121 __m256i initial_mins = _mm256_shuffle_epi8 (
122- _mm256_setr_epi8 (-128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
123- -128 , -128 , -128 , // 10xx => false
124- 0xC2 , -128 , // 110x
125- 0xE1 , // 1110
126- 0xF1 , // 1111
127- -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
128- -128 , -128 , -128 , // 10xx => false
129- 0xC2 , -128 , // 110x
130- 0xE1 , // 1110
131- 0xF1 ), // 1111
122+ _mm256_setr_epi8 (-128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
123+ -128 , -128 , -128 , // 10xx => false
124+ 0xC2u , -128 , // 110x
125+ 0xE1u , // 1110
126+ 0xF1u , // 1111
127+ -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
128+ -128 , -128 , -128 , // 10xx => false
129+ 0xC2u , -128 , // 110x
130+ 0xE1u , // 1110
131+ 0xF1u ), // 1111
132132 off1_hibits);
133133
134134 __m256i initial_under = _mm256_cmpgt_epi8 (initial_mins, off1_current_bytes);
135135
136136 __m256i second_mins = _mm256_shuffle_epi8 (
137- _mm256_setr_epi8 (-128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
138- -128 , -128 , -128 , // 10xx => false
139- 127 , 127 , // 110x => true
140- 0xA0 , // 1110
141- 0x90 , // 1111
142- -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
143- -128 , -128 , -128 , // 10xx => false
144- 127 , 127 , // 110x => true
145- 0xA0 , // 1110
146- 0x90 ), // 1111
137+ _mm256_setr_epi8 (-128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
138+ -128 , -128 , -128 , // 10xx => false
139+ 127 , 127 , // 110x => true
140+ 0xA0u , // 1110
141+ 0x90u , // 1111
142+ -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 , -128 ,
143+ -128 , -128 , -128 , // 10xx => false
144+ 127 , 127 , // 110x => true
145+ 0xA0u , // 1110
146+ 0x90u ), // 1111
147147 off1_hibits);
148148 __m256i second_under = _mm256_cmpgt_epi8 (second_mins, current_bytes);
149149 *has_error = _mm256_or_si256 (*has_error,
0 commit comments