UTF-8 validation in x86-64: a scalar reference and an AVX2 version that checks 32 bytes per step. Every build fuzzes one against the other.
vzeroupper before the only ret
Browse filesThe function returned with the upper halves of ymm0-5 dirty, and legacy SSE code in the caller pays for that: a state transition on older Intel cores, a false dependency on newer ones.
failing
6 steps in 1 ms
1 file changed
+1−0
@@ -135,4 +135,5 @@ utf8_valid_avx2:
135135 vptest ymm2, ymm2
136136 setz al
137137 movzx eax, al
138+ vzeroupper
138139 ret