WItam, który z poniższych kodów będzie wydajniejszy?
Wersja 1:
push ebp
mov ebp, esp
mov eax, DWORD PTR _data$[ebp]
mov ecx, 15
cmp eax, 10
cmova eax, ecx
mov DWORD PTR _data$[ebp], eax
mov eax, DWORD PTR _data$[ebp+4]
cmp eax, 10
cmova eax, ecx
mov DWORD PTR _data$[ebp+4], eax
mov eax, DWORD PTR _data$[ebp+8]
cmp eax, 10
cmova eax, ecx
mov DWORD PTR _data$[ebp+8], eax
mov eax, DWORD PTR _data$[ebp+12]
cmp eax, 10
cmova eax, ecx
mov DWORD PTR _data$[ebp+12], eax
mov eax, DWORD PTR ___$ReturnUdt$[ebp]
movups xmm0, XMMWORD PTR _data$[ebp]
movups XMMWORD PTR [eax], xmm0
pop ebp
ret 20
Wersja 2:
push ebp
mov ebp, esp
mov eax, DWORD PTR _data$[ebp]
cmp DWORD PTR [eax], 10
jbe SHORT $LN2@changeByRe
mov DWORD PTR [eax], 15
cmp DWORD PTR [eax+4], 10
jbe SHORT $LN3@changeByRe
mov DWORD PTR [eax+4], 15
cmp DWORD PTR [eax+8], 10
jbe SHORT $LN4@changeByRe
mov DWORD PTR [eax+8], 15
cmp DWORD PTR [eax+12], 10
jbe SHORT $LN5@changeByRe
mov DWORD PTR [eax+12], 15
pop ebp