Move comments about implementing memory and speculation barriers into its own Markdown file and expand it a bit.
Put code specific to each architecture in its own header file.
Use mfence; lfence for a total barrier on x86 instead of cpuid. This is partly for the reasons in docs/fencing.md but also so we have one canonical instruction sequence everywhere we're using it.
Rename CLFlush to FlushDataCacheLine to avoid the x86-specific name. Add FlushFromDataCacheLineNoBarrier for places where we flush in a loop, since we can just have one serialization barrier at the end.
Move comments about implementing memory and speculation barriers into its own Markdown file and expand it a bit.
Put code specific to each architecture in its own header file.
Use
mfence; lfence
for a total barrier on x86 instead ofcpuid
. This is partly for the reasons indocs/fencing.md
but also so we have one canonical instruction sequence everywhere we're using it.Rename
CLFlush
toFlushDataCacheLine
to avoid the x86-specific name. AddFlushFromDataCacheLineNoBarrier
for places where we flush in a loop, since we can just have one serialization barrier at the end.