Hi ,
I have an itoa ASM implementation. I would like to us
SIMD for it. But trying to figure out which parts can be
written with SIMD instruction or how can it be changed
for use SIMD instructions ?
The mentioned ASM implemetation :
void myitoa(int num, char * numstr)
{
__asm {
mov ebx,numstr
mov esi, num
cmp esi, 0
jne nextdigit
mov [ebx],48
mov [ebx+1],0
jmp enditoa
nextdigit: mov eax, 66666667h
imul esi
sar edx, 2
lea ecx, [edx + edx*4]
add ecx,ecx
mov eax,esi
sub eax,ecx
add eax,48
mov [ebx],al
inc ebx
mov esi,edx
cmp esi,0
jnz nextdigit
mov [ebx],0
mov edx,numstr
nextChar: dec ebx
cmp ebx,edx
jle enditoa
mov eax,[edx]
mov ecx,[ebx]
mov [ebx],al
mov [edx],cl
inc edx
jmp nextChar
enditoa:
}
}