[issue19183] PEP 456 Secure and interchangeable hash algorithm
Serhiy Storchaka
report at bugs.python.org
Tue Oct 29 22:20:05 CET 2013
Serhiy Storchaka added the comment:
About memcpy(). Here is sample file. Compile it to assembler:
gcc -O2 -S -masm=intel fnv.c
With memcpy() main loop is compiled to:
.L8:
movzx ecx, BYTE PTR [ebx+edx]
imul eax, eax, 1000003
add edx, 1
xor eax, ecx
cmp edx, edi
jne .L8
With per-byte copy it is compiled to:
.L3:
mov dl, BYTE PTR [ecx]
imul eax, eax, 1000003
sub ebp, 1
movzx ebx, BYTE PTR [ecx+1]
movzx edi, BYTE PTR [ecx+2]
movzx esi, BYTE PTR [ecx+3]
add ecx, 4
mov dh, bl
sal edi, 16
movzx edx, dx
sal esi, 24
or edx, edi
or edx, esi
xor eax, edx
cmp ebp, -1
jne .L3
----------
Added file: http://bugs.python.org/file32414/fnv.c
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19183>
_______________________________________
More information about the Python-bugs-list
mailing list