|
From: Nicholas N. <nj...@cs...> - 2005-07-19 00:48:35
|
On Thu, 5 May 2005, Jeremy Fitzhardinge wrote: >> Maybe it's worth giving more of an explanation here. I've noticed while floating around on the internet >> that people thing valgrind is just being pedantic when giving this warning and target < source. There are >> two problems: >> >> (1) if copying is done from largest address to smallest address. I don't know of any memcpy that does this. >> > > The some optimisation guide (AMD? Via?) recommends it for some cases. > >> (2) if memcpy zeroes out the target before copying. This has been shown to improve the performance of memcpy >> on some intel architectures, due to cache effects. Of course it is fatal if there is any overlap between >> source and target. Most memcpy's don't do this kind of trick, but it's worth keeping in mind. >> > > I think it's common on the PPC, because the dcbz instruction zeros a > cache line in preparation for the destination write (this is based on 5 > year old PPC experience, so I don't know what's best on a modern > implementation). I've updated the 3.0 docs for this. N |