given this piece of asm code:
(Line 1) .L6:
(Line 2) movsd -8(%rdx,%rax,8), %xmm0
(Line 3) .L2:
(Line 4) addsd (%rcx,%rax,8), %xmm0
(Line 5) movsd %xmm0, (%rdx,%rax,8)
(Line 6) addq $1, %rax
(Line 7) cmpq %rax, %r8
(Line 8) jne .L6
1 ) What is the dependency between xmm0 in Line 2 and Line 4? Is my guess of it being Read after Write correct?
2 ) What about the dependency between line 4 and 5? In line 4, it does seem like xmm0 is being both read and written (in that order). And in line 5 it's being read and then copied into the location (%rdx,%rax,8). So is it Read after Read? Or Read After Write?
I'm confused as there are more than 2 (read,write,read) operations happening so not sure which ones would be considered when looking at data dependencies.
this is the c code:
void randomgenericfunction(double a[], double p[], long n)
{
long i;
p[0] = a[0];
for (i=1; i<n; i++) {
p[i] = p[i-1] + a[i];
}
return;
}
Any help will be appreciated, thanks!