This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fprefetch-loop-arrays on PowerPC
>
> 232 template<typename _RandomAccessIter, typename _OutputIter>
> 233 inline _OutputIter
> 234 __copy(_RandomAccessIter __first, _RandomAccessIter __last,
> 235 _OutputIter __result,
> 236 random_access_iterator_tag)
> 237 {
> 238 typedef typename iterator_traits<_RandomAccessIter>::difference_type
> 239 _Distance;
> 240 for (_Distance __n = __last - __first; __n > 0; --__n) { <<this
> 241 *__result = *__first; <<loop
> 242 ++__first; <<
> 243 ++__result; <<
> 244 }
> 245 return __result;
> 246 }
...
> L..253:
> .line 241
> lwz 0,0(11)
> lwz 9,4(11)
> .line 242
> addi 11,11,8
> .line 241
> stw 0,0(10)
> stw 9,4(10)
> .line 243
> addi 10,10,8
> .line 241
> dcbt 0,28 < ===========
> dcbtst 0,28 < ===========
> .line 240
> bdnz L..253
> L..245:
Hmm, I am getting somewhat confused by PPC assembly. The loop is
copying data fom first to result, so I guess it is OK to have two
prefetches, one for read and one for write.
But what does the ,28 mean? Is that register number? If so, where it
gets initialized?
Perhaps the address computation goes somewhere wrong and gets
elliminated as dead. I will try to buyild PPC cross and figure out why
it happends after finals. In case you do have some time, can you just
compile it with -dL -dB and send me the files produced?
THanks,
Honza