[PATCH] Mantaining turnstile aligned to 128 bytes in i386 CPUs

Chuck Swiger cswiger at mac.com
Thu Jan 18 22:52:07 UTC 2007


On Jan 18, 2007, at 1:57 PM, Maxim Sobolev wrote:
> Heh, it's so complex, so machine-dependent....

Well, yes.  :)

> That makes me wonder why we still don't have 3 simple to use  
> instructions that do equivalent of memmove(), memcpy() and memset()  
> all in hardware in the best possible way with the respect of block  
> size, alignment, caches, chipset, you-name-it? Virtually every  
> program would benefit from such instructions.

Unfortunately, there are simply different tradeoffs between  
mechanisms for copying depending on whether you want to use or avoid  
using/thrashing the L1/L2 caches, whether the data is cache-aligned,  
and so forth; the CPU can't infer what you want to occur-- you have  
to tell it.  I find it interesting that some of the architectures (PA- 
RISC, SPARC) do allow for simple instructions with cache-control  
hinting:

   http://gcc.gnu.org/projects/prefetch.html

-- 
-Chuck



More information about the freebsd-arch mailing list