I would like to know what could be the reason for the compiler to generate such assembly code.
I am using the Intel(R) Composer XE 2013 Update 3 (package 171) under Windows 7 64 bit.
Flags : /EHa /GR /O3 /Oi /Ot /Oa- /Qip /QxSSE4.2 /Qstd=c++0x /Z7
Why the hell is is reading the _ptData variable so many times? (first in rax then going into r8 ,r9 ,r10 and finally back into rax!!!)
I do have the impression that it is falling back to debug code here.
And just in advance I can't provide some special code to reproduce it (I don't have the time to try to reproduce the issue) . I just want some general advices if possible about things I could try to remediate the issue.
000007FEECB621CE 48 89 85 A8 00 00 00 mov qword ptr [_ptData],rax
_ptData.common_data = &localData->common_data;;
000007FEECB621D5 48 8B 95 A8 01 00 00 mov rdx,qword ptr [localData]
000007FEECB621DC 48 8D 4A 70 lea rcx,[rdx+70h]
000007FEECB621E0 4C 8B 85 A8 00 00 00 mov r8,qword ptr [_ptData]
000007FEECB621E7 49 89 48 10 mov qword ptr [r8+10h],rcx
_ptData.x = x;
000007FEECB621EB 4C 8B 8D A8 00 00 00 mov r9,qword ptr [_ptData]
000007FEECB621F2 66 45 89 61 28 mov word ptr [r9+28h],r12w
_ptData.y = y;
000007FEECB621F7 4C 8B 95 A8 00 00 00 mov r10,qword ptr [_ptData]
000007FEECB621FE 66 41 89 72 2A mov word ptr [r10+2Ah],si
_ptData.frameBuffer = frameBufferOrigin +y *bpl + x * bpp;
000007FEECB62203 44 8B 5D 0C mov r11d,dword ptr [bpl]
000007FEECB62207 41 0F AF F3 imul esi,r11d
000007FEECB6220B 48 63 F6 movsxd rsi,esi
000007FEECB6220E 48 03 B5 90 00 00 00 add rsi,qword ptr [pos_delta]
000007FEECB62215 8B 45 10 mov eax,dword ptr [bpp]
000007FEECB62218 44 0F AF E0 imul r12d,eax
000007FEECB6221C 4D 63 E4 movsxd r12,r12d
000007FEECB6221F 49 03 F4 add rsi,r12
000007FEECB62222 48 8B 85 A8 00 00 00 mov rax,qword ptr [_ptData]
000007FEECB62229 48 89 70 20 mov qword ptr [rax+20h],rsi